SNS Documentation
SNS Documentation
SYNOPSIS
“SOCIAL NETWORKING SITE” is the place where persons after creating their
account can share their ideas on various topics. This project aims to develop a website for
people to communicate. People who wants to share their ideas and give their views for creating
social awareness can use this application. In this project user to create profile, share the information
with friends. They can create the growing network information. Users once Registered can establish
their , views about social responsibilities and made publically as well. This project provides ideas of
developing the application called as social networking sites.
1
PROJECT PROFILE
The purpose of the project is to build an Website to reduce the manual work for
managing the Users, Videos, Posts, Shares. Site takes care of different modules. They are:
❑ ADMIN MODULE
❑ USER MODULE
❑ POST MODULE
❑ FRIEND MODULE
❑ GALLERY MODULE
❑ CHAT MODULE
2
2.1.MODULE DESCRIPTION
1.ADMIN MODULE:
• LOGIN: Admin can login in his personal account using id and password.
2.USER MODULE:
• LOGIN: User can login their personal account using username and
password.
• EDIT PROFILE: The users can edit their profile.
3.POST:
• LIKE & COMMENT : User can like the post and share their
thoughts via comments.
4.FRIENDS :
5.GALLERY :
• SAVE : User can save the pictures and videos as their like.
6.CHAT :
3
ADVANTAGES:
LIMITATIONS :
4
3.SYSTEM ANALYSIS
➢ In general people share their ideas and knowledge from their colleagues or friends
through the intercom or direct manner. They need to spend time for their work.
➢ Some of the drawbacks are:
2. It is not user-friendly.
BENEFITS:
5
4.SYSTEM REQUIREMENTS
6
4.3 SOFTWARE DESCRIPTION
PROJECT DESCRIPTION:
This section describes the software and hardware requirements of the system.
HTML Introduction
HTML, an acronym for HyperText Markup Language, is a primary markup language for
creating websites. It consists of a series of codes used to structure texts, images, and other
content to be displayed in a browser
HTML element is a main structural unit of a web page. HTML tags are used to
define HTML elements, and attributes provide additional information about these elements.
HTML Tags:
HTML tags are used to structure website content (text, hyperlinks, images, media,
etc). Tags are not displayed in the browsers, they only “instruct” browsers how to show the
content of the web page.
There are over 100 tags in HTML, and we can find them in our HTML tutorial.
HTML tags are written in angle brackets (e.g <html>).
Most of HTML tags comes in pairs, like <p> </p> tags. The first tag in a pair called
the start (opening) tag, and the second tag is the end (closing) tag. The information is
written between opening and closing tags.
However, there are unpaired, or empty tags, which only have opening tag. (for ex.
<img/>).
7
If we need to define a paragraph (which is an element ) we should use <p> tag. The content
of the paragraph we should write between opening (<p>) and closing (</p>) tags.
Example
HTML ATTRIBUTES
The <!DOCTYPE html> declaration specifies the HTML version used in the
document. Every HTML document should start with this declaration so that the browsers
can render the page compliant with HTML standards.
There exist several types of <!DOCTYPE> defined for each HTML version.
All the content on the webpage is written between <html> </html> tags. The <html>
element is used to give information to the browsers that it is an HTML document.
The <head> element contains metadata (data about the HTML document), character
set, document title, styles, etc. This data is not shown to viewers.
The <title> displays the title of the website in the browser tab when the page is
loaded. The title is written between <title> </title> tags.
The <body> element contains the content of the webpage (text, images, videos, etc).
Heading elements contain different types of headings. There are six heading levels -
<h1>-<h6>, where <h1> is the most important and <h6> least important tags.
The <p> element contains paragraphs of the text. The content is written between
<p> and </p> tags.
CSS ;
8
CSS handles the look and feel part of a web page. Using CSS, we can control the
color of the text, the style of fonts, the spacing between paragraphs, how columns are sized
and laid out, what background images or colors are used, lawet designs,variations in display
for different devices and screen sizes as well as a variety of other effects.
CSS is easy to learn and understand but it provides powerful control over the
presentation of an HTML document. Most commonly, CSS is combined with the markup
languages HTML or XHTML.
ADVANTAGES OF CSS ;
➢ CSS saves time − We can write CSS once and then reuse same sheet in multiple
HTML pages. We can define a style for each HTML element and apply it to as many
Web pages as we want.
➢ Pages load faster − If we are using CSS, we do not need to write HTML tag
attributes every time. Just write one CSS rule of a tag and apply it to all the
occurrences of that tag. So less code means faster download times.
➢ Easy maintenance − To make a global change, simply change the style, and all
elements in all the web pages will be updated automatically.
➢ Superior styles to HTML − CSS has a much wider array of attributes than HTML,
so we can give a far better look to wer HTML page in comparison to HTML
attributes.
➢ Multiple Device Compatibility − Style sheets allow content to be optimized for
more than one type of device. By using the same HTML document, different
versions of a website can be presented for handheld devices such as PDAs and cell
phones or for printing.
➢ Global web standards − Now HTML attributes are being deprecated and it is being
recommended to use CSS. So its a good idea to start using CSS in all the HTML
pages to make them compatible to future browsers.
PYTHON:
9
beginners, Python has simple easy-to-use syntax. This makes Python an excellent language
to learn to program for beginners.
EASY TO LEARN: Learning python is easy as this is a expressive and high level
programming language, which means it is easy to understand the language and thus easy to
learn.
CROSS PLATFORM: Python is available and can run on various operating systems such
as Mac, Windows, Linux, Unix etc. This makes it a cross platform and portable language.
LARGE STANDARD LIBRARY: Python comes with a large standard library that has
some handy codes and functions which we can use while writing code in Python.
FREE: Python is free to download and use. This means we can download it for free and use
it in were application.Python is an example of a FLOSS (Free/Libre Open Source Software),
which means we can freely distribute copies of this software, read its source code and
modify it.
APPLICATIONS OF PYTHON
WEB DEVELOPMENT – Web framework like Django and Flask are based on Python.
They help we write server side code which helps we manage database, write backend
programming logic, mapping urls etc.
10
MACHINE LEARNING – There are many machine learning applications written in
Python. Machine learning is a way to write a logic so that a machine can learn and solve a
particular problem on its own. For example, products recommendation in websites like
Amazon, Flipkart, eBay etc. is a machine learning algorithm that recognises user’s interest.
Face recognition and Voice recognition in wer phone is another example of machine
learning.
DATA ANALYSIS – Data analysis and data visualisation in form of charts can also be
developed using Python.
FLASK :
Flask is a web framework. This means flask provides we with tools, libraries and
technologies that allow we to build a web application. This web application can be some
web pages, a blog, a wiki or go as big as a web-based calendar application or a commercial
website.
11
such frameworks, famous among which are Django and Flask.Python Flask Framework is a
lightweight micro-framework based on Werkzeug, Jinja2. It is called a micro framework
because it aims to keep its core functionality small yet typically extensible to cover an array
of small and large applications. Flask Framework depends on two external libraries: The
Jinja2 template, Werkzeug WSGI toolkit. Even though we have a plethora of web-apps at
our disposal, Flask tends to be better suited due to –
INITIALIZATION: Flask applications must create an application instance. The web server
passes all the requests it receives from clients to objects for handling using a protocol for
WSG from flask import Flask app = Flask ( name ) (The application instance is an object
of class Flask.)
Clients send requests to the webserver, in turn, sends them to the Flask application
instance.
12
The instance needs to know what code needs to run for each URL requested, keeps a
mapping of URLs to Python functions.
The association between a URL and the function that handles it is called a route,
most convenient way to define a route in a Flask application is through the (app.route).
Decorator exposed by the application instance, which registers the ‘decorated function,’
decorators are python feature that modifies the behavior of a function. @app.route('/')
def index():
return 'Xenonstack'
The index is a view function, and the response can even be a string format HTML.
SERVER STARTUP – The application instance has a ‘run’ method that launches flask’s
integrated development web server –
app.run(debug=True)
Once the script starts, it waits for requests and services in a loop.
Local-Host – Run a python script in a virtual environment. Flask starts the server listening
on and port 5000 by default. To accept connection from any remote address, use host =
‘0.0.0.0.’
HTTP METHODS
Request – To process incoming data in Flask, we need to use the request object, which
includes mime-type, IP address, and data. HEAD: Un-encrypted data sent to server w/o
response.
POST – Read form inputs and register a user, send HTML data to the server are methods
handled by the route.
Flask attaches methods to each route so that different view functions can handle different
request methods to the same URL.
Response – Flask invokes a view function, it has to return a response value to the client.
HTTP requires it to be more than a string response, a status code
➢ Informational – 1xx
13
➢ Successful – 2xx
➢ Redirection – 3xx
➢ Client Error – 4xx
➢ Server Error – 5xx
Templates – To maintain the site. Flask uses a powerful template engine ‘Jinja2’, in its
simplest form, a Jinja2 template is a file that contains the text of a response, returned by a
view function that has a dynamic component represented by a variable.
Linking – Dynamic url routing support is included using ‘url_for()’ helper function. For
example, url_for('sagar', name='project_file', _external=True) would return
http://localhost:5000/sagar/project_file.
A Database Management System (DBMS) is a software application that interacts with the
user, applications and the database itself to capture and analyze data. The data stored in the
database can be modified, retrieved and deleted, and can be of any type like strings,
numbers, images etc.
TYPES OF DBMS
There are mainly 4 types of DBMS, which are Hierarchical, Relational, Network, and
Object- Oriented DBMS.
Hierarchical DBMS: As the name suggests, this type of DBMS has a style of predecessor-
successor type of relationship. So, it has a structure similar to that of a tree, wherein the
nodes represent records and the branches of the tree represent fields.
Relational DBMS (RDBMS): This type of DBMS, uses a structure that allows the users to
identify and access data in relation to another piece of data in the database.
Network DBMS: This type of DBMS supports many to many relations wherein multiple
member records can be linked.
14
Object-oriented DBMS: This type of DBMS uses small individual software called objects.
Each object contains a piece of data, and the instructions for the actions to be done with the
data.
MySQL
It is one of the most popular database management systems originally launched way
back in 1995. SQL is the core of MySQL. And ‘My’ with ‘SQL’ is there because it’s the
name of its co-founder Michael Widenius’ daughter. It is an open-source relational database
management system.
MySQL is a freely available database system. However, there are several paid
editions also available with which we can use advanced functionality. MySQL is easy to use
as compared to other database software such as Microsoft SQL Server and Oracle database
etc. It can be used with any programming language
Features of MySQL
Ease of Management – The software very easily gets downloaded and also uses an event
scheduler to schedule the tasks automatically.
High Performance – Provides fast load utilities with distinct memory caches and table
index partitioning.
Low Total Cost Of Ownership – This reduces licensing costs and hardware expenditures.
Open Source & 24 * 7 Support – This RDBMS can be used on any platform and offers
24*7 support for open source and enterprise edition.
Secure Data Protection – MySQL supports powerful mechanisms to ensure that only
authorized users have access to the databases.
High Availability – MySQL can run high-speed master/slave replication configurations and
it offers cluster servers.
15
Numeric – This data type includes integers of various sizes, floating-point(real) of various
precisions and formatted numbers.
Character-string – These data types either have a fixed, or a varying number of characters.
This data type also has a variable-length string called CHARACTER LARGE OBJECT
(CLOB) which is used to specify columns that have large text values.
Scalability & Flexibility – With MySQL we can run deeply embedded applications and
create data warehouses holding a humongous amount of data.
Timestamp & Interval – The TIMESTAMP data type includes a minimum of six
positions, for decimal fractions of seconds and an optional WITH TIME ZONE qualifier in
addition to the DATE and TIME fields. The INTERVAL data type mentions a relative value
that can be used to increment or decrement an absolute value of a date, time, or timestamp.
Bit-string – These data types are either of a fixed length or varying length of bits. There is
also a variable-length bit string data type called BINARY LARGE OBJECT(BLOB), which
is available to specify columns that have large binary values, such as images.
Boolean – This data type has TRUE or FALSE values. Since SQL, has NULL values, a
three-valued logic is used, which is UNKNOWN.
Date & Time – The DATE data type has: YEAR, MONTH, and DAY in the form YYYY-
MM-DD. Similarly, the TIME data type has the components HOUR, MINUTE, and
SECOND in the form HH:MM: SS. These formats can change based on the requirement
16
5.SYSTEM DESIGN
Social Networking
Sites
17
5.1.1. DATA DICTIONARY :
NAME TYPE
FirstName VarChar
UserName VarChar
DOB INTEGER
Gender VarChar
MoblieNumber INTEGER
Email id VarChar
Password VarChar
UserName VarChar
NAME TYPE
UserName VarChar
Post Varchar
File varchar
Date date
18
TABLE NAME: GALLERY
NAME TYPE
UserName VarChar
Post Varchar
Rectangle =
Arrow =
Circle =
Open rectangle =
19
ADMIN MODULE:
USER MODULE :
LOGIN
USER
HOME
REGISTER
POST MODULE :
UPLOAD
USER POST
POST
20
FRIEND MODULE :
ADD
USER FRIEND
FRIEND
FRIEND PROFILE
CHAT MODULE :
SEND
USER &RECEIVE
MESSAGE CHAT
GALLERY MODULE :
SAVE
IMAGES
USER
INFORMATION AND GALLERY
VIDEOS
21
5.4 DETAILED DESIGN
5.4.1.INPUT DESIGN :
The main objective in output design is to specify how the information is put into a
term that is acceptable to computer. The files and database information, frequency and
certificate requirements are considered in the selection of input format. Another objective is
to ensure that input is acceptable and understandable to user.
When data is fed into a system, the operator must receive in that can understood reality. The
operator should key the data in the order in which it occurs on the forum and the computer
should reformat it as required.
5.4.2.OUTPUT DESIGN
The output information must be provided in such a format that the people can
understand. After analysing the operation of the system. In addition to this, these outputs
may be in a format suitable to input for subsequent processing.
Computers output is the most important and direct source of information to the user.
Efficient intelligence output design should improve the system relationship with the user
and help in decision making.
22
6. SYSTEM IMPLEMENTATION
The implementation phase of software development is concerned with translating design
specification into source code. The primary goal of implementation is to write source code
and internal documentation so that conformance of the code to its specifications can be
easily verified and so that debugging, testing and modification are eased. This goal can be
achieved by making the source code as clear and straight forward as possible. This stage
consists of
It involves careful maintaining, investigation of the current system and its constraints
and implementation, design of methods to achieve the changeover methods. Apart from
maintenance, there are two major tasks of preparing for implementations are education and
training of users and system testing.
The more complex, the system being implemented, the more involved will be the system
analysis and design effort required just for implementation co-coordinating committee
depends on policy at individual organizations. The committee will be sounding board for
ideas, complaints and problems in the user department. The coordination and control require
careful maintenance and the establishment of schedules.
The system has been tested with sample data and adequate corrections were made as per
user requirements. The user has very little chances of making data entry errors since enough
validation checks and validation error message are provided in the system. The end user
with minimum amount of computer knowledge will be able to key in the data and
understand the error messages. All reports have been found to satisfy their requirements.
23
7. SYSTEM TESTING
Testing is the major quality control measure employed during software
development. Its basic function is to be detecting errors in the software. During requirement
analysis and design the output is a document that is textual and non-executed for testing
purpose. This implies that testing not only to recover error introducing during coding but
also error introduced during the previous phases. The goal of testing is to uncover
requirement design or coding error in the program so, different levels of testing are
employed.
UNIT TESTING
The procedure level testing is made first. By giving improper inputs, the errors occurred are
noted and eliminated. Then the web form level testing is made. For example storage of data
to the table in the correct manner.
The dates are entered in wrong manner and checked. Wrong email-id and web site URL
(Universal Resource Locator) is given and checked.
SYSTEM TESTING
These tests are designed to intentionally two kinds of activities, integration testing and
acceptance testing. Strategies for integration software components into a functional product
include the bottom up strategy and top down strategy. Careful planning and scheduling and
required to ensure that the modules will be available for integration strategy decade the
order in which the module must be available and the experts influence on the integration
testing strategized.
INTEGRATION TESTING
Testing is done for each module. After testing all the modules, the modules are integrated
and testing of the final system is done with the test data, specially designed to show that the
system will operate successfully in all its aspects conditions. Thus the system testing is a
confirmation that all is correct and an opportunity to show the user that the system works.
VALIDATION TESTING
The final step involves Validation testing, which determines whether the software function
as the user expected. The end-user rather than the system developer conduct this test most
24
software developers as a process called “Alpha and Beta Testing” to uncover that only the
end user seems able to find.
The compilation of the entire project is based on the full satisfaction of the end
users. In the project, validation testing is made in various forms. In registration form Email
id, phone number and also mandatory fields for the user is verified.
VERIFICATION TESTING
The objectives of this maintenance work are to make sure that the system gets into
work all time without any bug. Provision must be for environmental changes which may
affect the computer or software system. This is called the maintenance of the system.
Nowadays there is the rapid change in the software world. Due to this rapid change, the
system should be capable of adapting these changes. In our project the process can be added
without affecting other parts of the system. Maintenance plays a vital role. The system
liable to accept any modification after its implementation. This system has been designed to
favour all new changes. Doing this will not affect the system’s performance or its accuracy.
25
8. CONCLUSION
Social media is a really convenient and important communication network for all the people
nowadays. We can use it to know friends and keep contact with friends that came from
different countries. We can also share our ideas so quickly so that all the things could
develop so fast because people could tell us their ideas and we could improve it
immediately.
It also helps in creating a community based on single minded thought who can share their
knowledge. This project is designed to adaptable to new future enhancements made with it
maintaining same efficiency.
26
8.1. APPENDIX-A SAMPLE SCREEN
HOME PAGE
USER REGISTRATION
27
USER LOGIN
USER PROFILE
28
USER GALLERY
ADMIN LOGIN
29
ADMIN MANAGING FORUM
FRIENDS
30
8.2. APPENDIX-B SAMPLE CODING
Social.py
import pymysql
import re
import os
import urllib.request
UPLOAD_FOLDER = 'static'
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
conn=pymysql.connect (host='localhost',user='root',password='',db='social')
cur = conn.cursor()
31
def allowed_file(filename):
@app.route('/home', methods=['GET','POST'])
def home():
user1=session['username']
dob=session['dob']
gender=session['gender']
mobilenumber=session['mobilenumber']
emailid=session['emailid']
f=cur.fetchone()
filename=f[1
render_template('home.html',filename=filename,user=user1,dob=dob,gender=gender,mobil
enumber=mobilenumber,emailid=emailid)
@app.route('/index', methods=['GET','POST'])
def index():
return render_template('index.html')
@app.route('/logout', methods=['GET','POST'])
def logout():
session.pop('loggedin', None)
session.pop('id', None)
session.pop('username', None)
32
# Redirect to login page
return render_template('logout.html')
@app.route('/photos', methods=['GET','POST'])
def photos():
user1=session["username"]
f=cur.fetchone()
filename1=f[1]
filename=""
if request.method=='POST':
file = request.files['file']
filename = secure_filename(file.filename)
file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
username=session["username"]
conn.commit()
gal=cur.fetchall()
return render_template('photos.html',filename=filename1,gal=gal)
@app.route('/post', methods=['GET','POST'])
def post():
33
username=session['username']
#post=request.
if request.method=='POST':
file = request.files['file']
filename = secure_filename(file.filename)
file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
username=session["username"]
conn.commit()
return render_template('home.html')
@app.route('/profile', methods=['GET','POST'])
def profile():
firstname=session['firstname']
lastname=session['lastname']
user1=session['username']
dob=session['dob']
gender=session['gender']
mobilenumber=session['mobilenumber']
emailid=session['emailid']
f=cur.fetchone()
34
filename=f[1]
return
render_template('profile.html',filename=filename,firstname=firstname,lastname=lastname,u
ser=user1,dob=dob,gender=gender,mobilenumber=mobilenumber,emailid=emailid)
@app.route('/signin', methods=['GET','POST'])
def signin():
msg = ''
username=''
# Check if "username" and "password" POST requests exist (user submitted form)
username = request.form['username']
password = request.form['password']
account = cur.fetchone()
if account:
session['loggedin'] = True
session['firstname']=account[0]
session['lastname']=account[1]
session['username'] = username
session['dob']=account[3]
session['gender']=account[4]
session['mobilenumber']=account[5]
35
session['emailid']=account[6]
return redirect(url_for('home'))
else:
msg='Incorrect username/password!'
return render_template('signin.html',msg=msg,user=username)
@app.route('/signin_form', methods=['GET','POST'])
def signin_form():
return render_template('signin_form.html')
@app.route('/signup', methods=['GET','POST'])
def signup():
msg = ''
# Check if "username", "password" and "email" POST requests exist (user submitted
form)
if request.method == 'POST':
firstname = request.form['firstname']
lastname = request.form['lastname']
username = request.form['username']
dob = request.form['dob']
gender = request.form['gender']
36
mobilenumber = request.form['mobilenumber']
emailid = request.form['email']
password = request.form['password']
registration = cur.fetchone()
if registration:
else:
# Account doesnt exists and the form data is valid, now insert new account into
accounts table
conn.commit()
return redirect(url_for('home'))
return render_template('signup.html')
@app.route('/signup_form', methods=['GET','POST'])
37
def signup_form():
return render_template('signup_form.html')
def timeline():
return render_template('timeline.html')
def friends():
registration = cur.fetchall()
return render_template('friends.html',registration=registration)
def fprofile(friend):
registration = cur.fetchone()
if registration:
firstname=session['firstname']
lastname=session['lastname']
user1=session['username']
dob=session['dob']
gender=session['gender']
mobilenumber=session['mobilenumber']
emailid=session['emailid']
38
return render_template('fprofile.html',registration=registration)
def updatecover():
return render_template('updatecover.html')
def deletecomment():
return render_template('delete_comment.html')
def deletephotos():
return render_template('deletephotos.html')
def admin():
registration = cur.fetchall()
return render_template('admin.html',registration=registration)
def user_info():
registration = cur.fetchall()
return render_template('user_info.html',registration=registration)
39
@app.route('/report', methods=['GET', 'POST'])
def report():
registration = cur.fetchall()
return render_template('report.html',registration=registration)
def editprofile():
firstname=session['firstname']
lastname=session['lastname']
user1=session['username']
dob=session['dob']
gender=session['gender']
mobilenumber=session['mobilenumber']
emailid=session['emailid']
if request.method == 'POST':
first=request.form["firstname"]
last=request.form["lastname"]
dob1=request.form["dob"]
gender1=request.form["gender"]
mobilenumber1=request.form["mobilenumber"]
conn.commit()
40
return
render_template('editprofile.html',firstname=firstname,lastname=lastname,user=user1,dob=
dob,gender=gender,mobilenumber=mobilenumber,emailid=emailid)
def updatephoto():
filename=""
if request.method=='POST':
file = request.files['file']
filename = secure_filename(file.filename)
file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
username=session["username"]
conn.commit()
return render_template('updatephoto.html',filename=filename)
@app.route('/display/<filename>')
def display(filename):
username=session['username']
f=cur.fetchone()
filename=f[1]
41
return redirect(url_for('static', filename=filename), code=301)
if __name__ == '__main__':
app.run()
Signin.html
<!DOCTYPE html>
<html>
<head>
<title>Welcome To Biobook - Sin up, Log in, Chat </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/signin.css')}}">
</head>
<body>
<div id="container">
<div class="sign-in-form">
<table>
<h1>Welcome to Biobook</h1>
<h2>Log in</h2>
<form method="post">
<tr>
<td><label>Username</label></td>
<td><input type="text" name="username"
placeholder="username" class="form-1" title="Enter username" required /></td>
</tr>
<tr>
<td><label>Password</label></td>
<td><input type="password" name="password"
placeholder="~~~~~~~~~~" class="form-1" title="Enter your password" required /></td>
42
</tr>
{{msg}}
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="submit" value="Log in"
class="btn-sign-in" title="Log in" />
<input type="reset" name="cancel" value="Cancel"
class="btn-sign-up" title="Cancel" /><br>
</td>
</tr>
</form>
<tr>
<td><label>NewUser</label></td>
<td colspan="4"><a href="{{url_for('signup')}}"
title="Register"><button class="btn-sign-in" value="Register">Register</button></a></td>
</td>
</tr>
</table>
</div>
</div>
43
</body>
</html>
Signup.html :
<!DOCTYPE html>
<html>
<head>
<title>Register - Sin up, Log in, Chat </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/signup.css')}}">
</head>
<body>
<div id="container">
<div class="sign-in-form">
<center>
<h1>REGISTER</h1>
</center>
<h2>Sign up</h2>
<b>All fields are required.</b>
<br />
<fieldset class="sign-up-form-1">
<form method="post" >
<table cellpadding="5" cellspacing="5">
<tr>
<td><label>First name*</label></td>
<td><label>Last name *</label></td>
</tr>
<tr>
44
<td><input type="text" name="firstname"
placeholder="Enter your firstname....." class="form-1" title="Enter your firstname" required
/></td>
<td><input type="text" name="lastname"
placeholder="Enter your lastname....." class="form-1" title="Enter your lastname" required
/></td>
</tr>
<tr>
<td><label>User name*</label></td>
<td><label>Repeat user name*</label></td>
</tr>
<tr>
<td><input type="text" name="username"
placeholder="Enter your username....." class="form-1" title="Enter your username"
required /></td>
<td><input type="text" name="username2"
class="form-1" title="Enter your username" required /></td>
</tr>
<tr>
<td colspan="2">Note: No one can follow your
username.</td>
</tr>
</table>
</fieldset>
<br />
<fieldset class="sign-up-form-1">
<legend>Profile information</legend>
<table cellpadding="5" cellspacing="5">
<tr>
<td><label>Birthday</label></td>
<td><input type="text" name="dob"
placeholder="Enter your Date of Birth"></td>
</tr>
<tr>
45
<td><label>Gender</label></td>
<td>
<label>Male</label><input type="radio"
name="gender" value="male" required />
<label>Female</label><input type="radio"
name="gender" value="female" required />
</td>
</tr>
<tr>
<td><label>Mobile number*</label></td>
<td><input type="text" name="mobilenumber"
placeholder="09...." maxlength="13" class="form-1" title="Enter your mobile number"
required /></td>
</tr>
</table>
</fieldset>
<br />
<fieldset class="sign-up-form-1">
<legend>Log in information*</legend>
<table cellpadding="5" cellspacing="5">
<tr>
<td><label>Your email address*</label></td>
<td><label>Repeat email *</label></td>
</tr>
<tr>
<td><input type="text" name="email"
placeholder="Enter your email address....." class="form-1" title="Enter your firstname"
required /></td>
<td><input type="text" name="email2" class="form-
1" title="Enter your lastname" required /></td>
</tr>
<tr>
<td colspan="2">Note: no-one can see your email
address.</td>
46
</tr>
<tr>
<td><label>Password*</label></td>
<td><label>Repeat password*</label></td>
</tr>
<tr>
<td><input type="password" name="password"
placeholder="Enter your password....." class="form-1" title="Enter your username"
required /></td>
<td><input type="password" name="password2"
class="form-1" title="Enter your username" required /></td>
</tr>
<tr>
<td colspan="2">Note: no-one else can see your
password.</td>
</tr>
</table>
</fieldset>
<br />
<br />
<br />
<input type="submit" name="submit" value="I Agree
- Continue" class="btn-sign-in" title="Log in" />
</form>
</div>
</div>
</body>
</html>
47
admin.html :
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/signin.css')}}">
</head>
<body>
<div id="container">
<div class="sign-in-form">
<table>
<h1>ADMIN LOGIN</h1>
<form method="post">
<tr>
<td><label>Username</label></td>
<td><input type="text" name="username"
placeholder="username" class="form-1" title="Enter username" required /></td>
</tr>
<tr>
<td><label>Password</label></td>
<td><input type="password" name="password"
placeholder="~~~~~~~~~~" class="form-1" title="Enter your password" required /></td>
</tr>
{{msg}}
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
48
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="submit" value="Log in"
class="btn-sign-in" title="Log in" />
<input type="reset" name="cancel" value="Cancel"
class="btn-sign-up" title="Cancel" /><br>
</td>
</tr>
</form>
</table>
</div>
</div>
</body>
</html>
User_info.html :
<!DOCTYPE html>
<html>
<head>
<title>Welcome To Biobook - Sign up, Log in, Post </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/profile.css')}}">
</head>
<body>
49
<form >
<h1>USER INFORMATION</h1>
<hr />
<br />
<div id="header">
<div class="head-view">
<ul>
<li><a href="{{url_for('user_info')}}" title="User
Info"><label>user information</label></a></li>
<li><a href="{{url_for('report')}}" title="Report"><label
>report</label></a></li>
<div class='info-user'>
<div>
<table border='2'>
<form method="post">
{% for col in registration %}
<tr><h3> <td>{{ col[0] }}</td></h3>
<h3> <td>{{ col[1] }} </td></h3>
<h3> <td>{{ col[2] }} </td></h3>
<h3> <td>{{ col[3] }} </td></h3>
<h3> <td>{{ col[4] }} </td></h3>
<h3> <td>{{ col[5] }} </td></h3>
<h3> <td>{{ col[6] }} </td></h3>
<h3> <td>{{ col[7] }} </td></h3></tr>
{% endfor %}
</div>
</form>
</body>
</html>
home.html :
<!DOCTYPE html>
<html>
<head>
<title>Welcome To Biobook - Sign up, Log in, Post </title>
50
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/home.css')}}">
</head>
<body>
<form method=post>
<div id="header">
<div class="head-view">
<ul>
<li><a href="{{url_for('home')}}"
title="Biobook"><b>biobook</b></a></li>
<li><a href="{{url_for('timeline')}}"
title="{{user}}"><label>{{user}}</label></a></li>
<li><a href="{{url_for('home')}}" title="Home"><label
class="active">Home</label></a></li>
<li><a href="{{url_for('profile')}}"
title="Home"><label>Profile</label></a></li>
<li><a href="{{url_for('photos')}}"
title="Settings"><label>Gallery</label></a></li>
<li><a href="{{url_for('friends')}}"
title="Friends"><label>Friends</label></a></li>
<li><a href="{{url_for('logout')}}" title="Log out"><button
class="btn-sign-in" value="Log out">Log out</button></a></li>
</ul>
</div>
</div>
</form>
<form method=post>
<div id="container">
<div id="left-nav">
<div class="clip1">
51
<a href="{{url_for('updatephoto')}}" title="Change Profile
Picture"><img src="{{url_for('static',filename=filename)}}">
</a>
</div>
<div class="user-details">
<h3>{{firstname}} {{lastname}}</h3>
<h2>{{user }}</h2>
</div>
</div>
</form>
<div id="right-nav">
<h1>Update Status</h1>
<div>
<form method="post" action="{{url_for('post')}}" >
<textarea placeholder="Whats on your mind?"
name="content" class="post-text" required></textarea>
<input type="file" name="file">
<button class="btn-share" name="Submit" value="Log
out">Share</button>
</form>
</div>
</div>
<div id="left-nav1">
<h2>Personal Info</h2>
<table>
<tr>
<td><label>Username</label></td>
<td width="20"></td>
<td><b>{{user}}</b></td>
</tr>
52
<tr>
<td><label>Birthday</label></td>
<td width="20"></td>
<td><b>{{dob}}</b></td>
</tr>
<tr>
<td><label>Gender</label></td>
<td width="20"></td>
<td><b>{{gender}}</b></td>
</tr>
<tr>
<td><label>Contact</label></td>
<td width="20"></td>
<td><b>{{mobilenumber}}</b></td>
</tr>
<tr>
<td><label>Email</label></td>
<td width="20"></td>
<td><b>{{emailid}}</b></td>
</tr>
</table>
</div>
<div id="right-nav1">
<div class="profile-pics">
<img src="{{profile_picture }}">
<b>{{posted_by }}</b>
<strong>{{time}}</strong>
</div>
<br />
<div class="post-content">
<div class="delete-post">
53
<a href="delete_post.php<?php echo '?id='.$post_id; ?>"
title="Delete your post"><button class="btn-delete">X</button></a>
</div>
<p>{{'content'}}</p>
<center>
<img src="{{location}}">
</center>
</div>
<div class="comment-display"{{comment_id}}>>
<div class="delete-post">
<a href="" title="Delete your comment"><button
class="btn-delete">X</button></a>
</div>
<div class="user-comment-name"><img
src="{{image}}"> <?php echo $row['name']; ?><b class="time-
comment"><?php echo $time = time_stamp($time); ?></b></div>
<div class="comment"><?php echo
$row['content_comment']; ?></div>
</div>
<br />
<form method="POST" >
<div class="comment-area">
54
<input type="hidden" name="image" value="<?php echo
$profile_picture ?>">
<input type="submit" name="post_comment" value="Enter"
class="btn-comment">
</div>
</form>
</div>
</div>
</form>
</body>
</html>
Profile.html :
<!DOCTYPE html>
<html>
<head>
<title>Welcome To Biobook - Sign up, Log in, Post </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/profile.css')}}">
</head>
<body>
<div id="header">
<div class="head-view">
<ul>
<li><a href="{{url_for('home')}}"
title="Biobook"><b>biobook</b></a></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
55
<li><a href="{{url_for('timeline')}}"
title="<{{user}}>"><label><{{user}}></label></a></li>
<li><a href="{{url_for('home')}}"
title="Home"><label>Home</label></a></li>
<li><a href="{{url_for('profile')}}" title="Profile"><label
class="active">Profile</label></a></li>
<li><a href="{{url_for('photos')}}"
title="Settings"><label>Gallery</label></a></li>
<li><a href="{{url_for('friends')}}"
title="Friends"><label>Friends</label></a></li>
<li><a href="{{url_for('logout')}}" title="Log out"><button
class="btn-sign-in" value="Log out">Log out</button></a></li>
</ul>
</div>
</div>
<div id="container">
<div id="left-nav">
<form method="post">
<div class="clip1">
<a href="{{url_for('updatephoto')}}" title="Change Profile
Picture"><img src="{{url_for('static',filename=filename)}}">
</a>
</div>
</form>
<div class="user-details">
<h3>{{firstname}} {{lastname}}</h3>
<h2>{{user}}</h2>
</div>
</div>
<form method="post">
56
<div id="right-nav">
<h1>Personal Info</h1>
<hr />
<br />
<div class='info-user'>
<div>
<label>Firstname</label> <b>"{{firstname}}"</b>
</div>
<hr />
<br />
<div>
<label>Lastname</label> <b>"{{lastname}}"</b>
</div>
<hr />
<br />
<div>
<label>Username</label> <b>"{{user}}"</b>
</div>
<hr />
<br />
<div>
<label>Birthday</label> <b>"{{dob}}"</b>
</div>
<hr />
<br />
<div>
<label>Gender</label> &
nbsp;<b>"{{gender}}"</b>
</div>
57
<hr />
<br />
<div>
<label>Mobile
Number</label> <b>"{{mobilenu
mber}}"</b>
</div>
<hr />
<br />
</div>
<br />
<div class='edit-info'>
<a href ="{{url_for('editprofile')}}">Edit Profile</a>
</div>
</form>
</body>
</html>
friends.html :
<!DOCTYPE html>
<html>
<head>
<title>Welcome To Biobook - Sign up, Log in, Post </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/profile.css')}}">
</head>
<body>
<form method="post">
<div id="header">
<div class="head-view">
<ul>
<li><a href="{{url_for('home')}}"
title="Biobook"><b>biobook</b></a></li>
58
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><a href="{{url_for('timeline')}}"
title="<{{user}}>"><label><{{user}}></label></a></li>
<li><a href="{{url_for('home')}}"
title="Home"><label>Home</label></a></li>
<li><a href="{{url_for('profile')}}" title="Profile"><label
>Profile</label></a></li>
<li><a href="{{url_for('photos')}}"
title="Settings"><label>Gallery</label></a></li>
<li><a href="{{url_for('friends')}}" title="Friends"><label
class="active">Friends</label></a></li>
<li><a href="{{url_for('logout')}}" title="Log out"><button
class="btn-sign-in" value="Log out">Log out</button></a></li>
</ul>
</div>
</div>
</form>
<div id="right-nav">
<form >
<h1>FRIENDS </h1>
<hr />
<br />
<div class='info-user'>
<div>
<table border='1'>
{% for col in registration %}
<h3> <tr>{{ col[2] }}
59
<button> <a href ="{{url_for('fprofile',friend="{{f}}")}}">View
profile</button></a>
<br></tr></h3><br>
{% endfor %}
</div>
<br />
<br />
</form> <br />
</div>
</div>
</form>
</body>
</html>
Post.html :
<?php
include('includes/database.php');
include('session.php');
if
(!isset($_FILES['image']['tmp_name'])) {
echo "";
}else{
$file=$_FILES['image']['tmp_name'];
$image = $_FILES["image"] ["name"];
$image_name=
addslashes($_FILES['image']['name']);
$size = $_FILES["image"] ["size"];
$error = $_FILES["image"] ["error"];
else
{
move_uploaded_file($_FILES["image"]["tmp_name"],"upload/" .
$_FILES["image"]["name"]);
$location="upload/" .
$_FILES["image"]["name"];
$user=$_SESSION['id'];
$content=$_POST['content'];
$time=time();
$update=mysql_query("
INSERT INTO post (user_id,post_image,content,created)
VALUES
('$id','$location','$content','$time') ") or die (mySQL_error());
61
9.FUTURE ENHANCEMENT
Further requirements and improvements can easily be done since the coding is
mainly structured or modular in nature. Changing the existing modules or adding new
modules can append improvements. Further enhancements can be made to the application,
so that the web site functions very attractive and useful manner than the present one. This
forum can be enhanced as discussion forum. It can be added with more categories to make
this forum more interactive. Commenting options can be added. To encourage user, like and
share option can be added which makes user to take part in forum actively.
62
10.BIBILIOGRAPHY
63