All Chapters
All Chapters
Chapter-1
Project-Profile
1.1-Project Definition
The project aims to develop a social media website that provides a platform for users to connect,
communicate, and share content with others. The website will serve as a virtual community where
individuals can create profiles, connect with friends or followers, and engage in social interactions.
It will enable users to share various types of content, including text, images, and and provide
features for liking, commenting, and sharing content within the network.
The primary goal of the project is to create a user-friendly and visually appealing social media
website that caters to the needs and preferences of the target audience. The website will offer a
seamless and intuitive user experience, with a responsive design that adapts to different devices
and screen sizes.
Privacy and security of user data will be a top priority, with robust measures implemented to
safeguard personal information and ensure a safe online environment. The website will provide
users with control over their privacy settings, allowing them to manage the visibility of their
content and choose who can access their profiles.
Additionally, the social media website will include features for notifications, allowing users to stay
updated on the activities and interactions of their friends and connections. Messaging functionality
will enable private conversations between users, enhancing communication within the community.
The project will involve a multidisciplinary team, including project managers, business analysts,
UX/UI designers, front-end and back-end developers, quality assurance engineers, technical
writers, and system administrators. They will work collaboratively to design, develop, test, and
deploy the social media website, ensuring its functionality, reliability, and performance.
Overall, the project aims to deliver a comprehensive social media platform that fosters connection,
engagement, and content sharing among users, while prioritizing user experience, privacy, and
security.
1.2-Project Description
The project involves the development of a social media website that aims to provide users with a
platform to connect, communicate, and share content with others in a virtual community. The
YourThoughts 1
Project Profile 2022 - 2023
website will serve as a central hub for users to create personal profiles, build networks of friends
or followers, and engage in social interactions.
Users will have the ability to share various types of content, such as text posts, images and links,
allowing them to express themselves and showcase their interests. The website will include
features for users to like, comment on, and share content within their network, fostering
engagement and interactions among users.
Privacy and security will be key considerations in the project. The social media website will
incorporate robust privacy settings, giving users control over the visibility of their profiles and
content. Measures will be implemented to protect user data and ensure a safe and secure online
environment.
The website will have a user-friendly and intuitive interface, designed to provide a seamless user
experience across different devices and screen sizes. Responsive design principles will be
employed to optimize the website's layout and functionality for desktop computers, laptops,
tablets, and mobile phones.
The project will involve a team of professionals with diverse roles and expertise, including project
managers, business analysts, UX/UI designers, front-end and back-end developers, quality
assurance engineers, technical writers, and system administrators. They will collaborate
throughout the project lifecycle to design, develop, test, and deploy the social media website.
The ultimate goal of the project is to deliver a feature-rich social media website that enables users
to connect with others, share content, and engage in meaningful interactions. The website will
provide an enjoyable and secure online platform for individuals to express themselves, build
relationships, and stay connected with friends, communities, and the world around them.
Scenario: Twitter Social Network is an existing social media website that has been in operation
for several years. The management of Twitter Social Network has decided to revamp and
enhance the website to meet the evolving needs of its users and stay competitive in the market.
The project team is tasked with conducting an assessment of the current website and work
environment before proceeding with the development of the new social media website.
YourThoughts 2
Project Profile 2022 - 2023
The team also reviews user feedback and discovers that users have expressed a desire for a more
intuitive user experience, improved mobile responsiveness, and better content discovery
mechanisms.
Competitor Analysis:
The team analyzes other popular social media websites like facebook Network and memchat
Social to understand their features and design.
They observe that Twitter Network excels in real-time news updates and event coverage, while
Facebook Social focuses on niche interest groups and forums.
Based on the analysis, the team identifies an opportunity to differentiate Twitter Social Network
by incorporating a combination of real-time updates, interest-based communities, and enhanced
privacy controls.
Technical Infrastructure:
The team assesses the current technical infrastructure of Twitter Social Network, including the
web servers, database systems, and network capabilities.
They find that the infrastructure is outdated and may not handle the increased traffic and data
demands of the enhanced social media website.
As a result, the team determines the need to upgrade the servers, optimize the database systems,
and ensure scalable architecture to accommodate future growth.
Integration Requirements:
The team identifies that ABC Social Network needs seamless integration with popular third-
party platforms like Facebook and Twitter to allow users to import their contacts and share
content across platforms.
They analyze the available APIs provided by these platforms to ensure smooth integration and
data synchronization between YourThoughts Social Network and external platforms.
Stakeholder Engagement:
The project team organizes meetings with management, marketing teams, and a focus group of
current YourThoughts Social Network users.
They gather feedback and understand stakeholders' expectations, such as the need for improved
monetization strategies, targeted advertising options, and seamless user experience across
devices.
The team ensures ongoing communication and involvement of stakeholders throughout the
development process.
YourThoughts 3
Project Profile 2022 - 2023
1.4-Problem Statements
This system developed will give the user a perfact interface for writing there articles and blogs.
The user can easily create there account on this website by there email and name. the user can
make there password for security of there account. the user can create there profile for easily
interaction to the people. There will be a timeline where every people see all other people article
and stories.
This project was developed to fulfil the requirement of common Social media platform
for educational purposes. However, there are lots of scope to improve the performance of
the Online Blogging System in the area of user interface, database performance, and
query processing time etc.
So, there are many things for future enhancement of this project. The future
enhancements that are possible in the project are as follows:
• Web based interface for generate reports, like who has published more contents,
who has commented most, the logged in time etc.
• Linking and integration of other online educational web sites.
• Integration with school/college database through Web Services.
YourThoughts 4
Project Profile 2022 - 2023
1.7-Scope
The Social media System will allow the users to publish the writings, images if he/she
should have credentials to login. The main users of this project are students, teachers and
administrators.
From an end-user perspective, the social media System project consists of following
functional elements:
• Dashboard: It is the default page of the site and we can access this option from
left hand side anytime. All links are available on this page. We can also find the
Quick Draft and Activity section here.
• Posts: Here we can see all the published contents by clicking on “All Posts”
option and we can also publish new content by “Add New” option.
• Media: We can see the uploaded media items ( images, ) by clicking on “Library”
option and we can also add new media item from local system with the help of
“Add New” button.
• Comments: In this section, we can check that who, when and what has been
commented.
• Profile: In this section, we can personalize our profile like Password Change,
Profile Picture Change, Display Name, Nickname etc.
• Tools: This option is having additional plugins to install, which may enhance the
current functionality.
YourThoughts 5
Project Profile 2022 - 2023
• Home Button: It is located at the top left portion and we can use this button to
check the timeline where we can view the contents published by everyone.
1.8-Outcomes
The system aims to promote critical and analytical thinking, increase access and exposure to
quality content, and provide a combination of solitary and social interactions with peers. It will
also help students to develop their communication and writing skills.
The Social media System project will utilize the following tools and technologies:
Front-end Development:
CSS (Cascading Style Sheets): For styling and designing the user interface.
Back-end Development:
PHP (Hypertext Preprocessor): A server-side scripting language for processing user requests
and generating dynamic web content.
MySQL: A relational database management system for storing user data, blog posts, and other
relevant information.
Laravel: A PHP web framework that provides a robust and scalable foundation for building web
applications. It offers features such as routing, database management, and authentication.
Version Control:
Git: A distributed version control system for tracking changes in the project's source code and
facilitating collaboration among developers.
YourThoughts 6
Project Profile 2022 - 2023
Visual Studio Code: A popular and lightweight code editor with excellent support for web
development.
Web Server:
Apache: A widely used web server software that will host the Online Blogging System
application.
jQuery: A JavaScript library for simplifying client-side scripting and DOM manipulation.
AJAX (Asynchronous JavaScript and XML): A technique for performing asynchronous server
requests and updating web content without reloading the entire page.
These tools and technologies will collectively contribute to the development and deployment of
the Online Blogging System, ensuring a robust, user-friendly, and feature-rich platform for users
to create and share their blog po
YourThoughts 7
Project Profile 2022 - 2023
1.10-Project Plan
YourThoughts 8
Requirement Analysis 2022 - 2023
Chapter-2
Requirement Analysis
A feasibility study is conducted to assess the viability and potential success of a project before
committing resources to its development. In the context of developing a social media website, a
feasibility study helps determine whether the project is technically, financially, and operationally feasible.
Here are the key aspects considered in a feasibility study:
Technical Feasibility:
Assess the technical requirements and capabilities needed to develop the social media website.
Evaluate the availability of required technologies, programming languages, frameworks, and
tools.
Determine if the development team has the necessary expertise and skills to implement the
required functionalities.
Consider any technical risks or challenges that may arise during the development process.
Financial Feasibility:
Analyze the project's financial aspects, including the estimated development costs and ongoing
maintenance expenses.
Evaluate the potential revenue streams, such as advertising, premium subscriptions, or
partnerships.
Consider the return on investment (ROI) and assess whether the project is financially viable and
sustainable.
Identify any potential funding sources or investment opportunities to support the development
and maintenance of the website.
Operational Feasibility:
Evaluate the operational aspects of running and managing the social media website.
Assess the availability of resources, such as human resources, infrastructure, and technical
support.
Consider the scalability of the website to handle increasing user activity and data storage
requirements.
Determine the feasibility of implementing necessary policies and procedures for user
management, content moderation, and data privacy.
Market Feasibility:
Conduct a market analysis to understand the target audience, user demographics, and
competition.
Identify the unique selling points and potential differentiators of the social media website.
Evaluate the demand for social media platforms and potential user adoption rates.
YourThoughts 9
Requirement Analysis 2022 - 2023
Risk Assessment:
Identify and assess potential risks and uncertainties associated with the project.
Evaluate the impact and likelihood of risks related to technology, market dynamics, competition,
and user adoption.
Develop risk mitigation strategies and contingency plans to minimize potential negative impacts.
The social media website will cater to various categories of users, each with their own roles,
responsibilities, and interactions within the system. Here are the key user categories:
Registered Users:
These are individuals who create an account on the social media website.
Registered users have their profiles, which they can customize and update with personal
information, profile pictures, and cover photos.
They can connect with other users by sending friend requests or following their profiles.
Registered users can post content, such as text updates, photos, videos, and links, on their
profiles or in designated community spaces.
They have the ability to like, comment on, and share content posted by other users.
Registered users can customize their privacy settings to control the visibility of their content and
manage their network connections.
Administrators:
Administrators have special privileges and responsibilities in managing the social media website.
They have the authority to enforce community guidelines, terms of service, and content
moderation policies.
Administrators can review reported content, handle user disputes, and take appropriate actions,
such as warning, suspending, or banning users who violate the platform's rules.
They have access to administrative tools and features to monitor system performance, manage
user accounts, and ensure the overall integrity and security of the website.
YourThoughts 10
Requirement Analysis 2022 - 2023
Content Creators:
Content creators are users who actively produce and share original content on the social
media website.
They may include bloggers, influencers, artists, photographers, journalists, and other
creative individuals.
Content creators play a crucial role in generating engaging and diverse content that
attracts and retains users on the platform.
They can gain visibility, recognition, and followers through their content and interactions
within the social media website.
Community Managers:
Community managers are responsible for cultivating and managing user communities
within the social media website.
They facilitate discussions, engage with users, and foster a positive and inclusive
environment.
Community managers may organize events, campaigns, or initiatives to encourage user
participation and interaction.
They provide support, address user concerns, and promote user-generated content that
aligns with the platform's objectives and values.
Public Users:
Public users refer to individuals who can access certain parts of the social media website
without creating an account.
They can view public profiles, read public posts, and engage in limited interactions, such
as liking or sharing public content.
Public users may decide to join the platform as registered users based on their
interactions and interests.
Each category of user plays a unique role in contributing to the social media website's
ecosystem, fostering connections, and shaping the overall user experience. The system is
designed to cater to the diverse needs and expectations of these users, providing them
with a platform to connect, share, and engage with others in a virtual community.
YourThoughts 11
Requirement Analysis 2022 - 2023
2.3 Modules:
Modules are distinct components or functionalities within a system. For the Online Blogging
System, the following modules can be identified:
Content Creation: Allows users to write, edit, and publish blog posts.
Search and Filtering: Provides functionality to search for specific blog posts or filter content
based on categories or tags.
Social Sharing: Allows users to share blog posts on social media platforms.
Notifications: Sends notifications to users for new comments or activity on their blog posts.
The process model outlines the sequence of activities and steps involved in the development and
deployment of the social media website. Different process models can be employed based on the
project's requirements, team size, timeline, and development approach. Here, we will discuss an
example process model commonly used in software development projects called the Agile
Scrum model.
Agile Scrum Model: The Agile Scrum model is an iterative and incremental process model that
promotes collaboration, flexibility, and rapid development. It consists of the following key
components:
a. Product Backlog:
The product backlog is a prioritized list of features, functionalities, and user stories that
need to be implemented in the social media website.
The product backlog is continuously refined and updated throughout the development
process based on user feedback, market trends, and stakeholder inputs.
YourThoughts 12
Requirement Analysis 2022 - 2023
b. Sprint Planning:
A sprint is a time-boxed iteration usually lasting 1-4 weeks.
At the beginning of each sprint, the development team and the product owner collaborate
to select a set of user stories from the product backlog to be implemented during the
sprint.
The team estimates the effort required for each user story and determines the sprint goal.
c. Sprint Execution:
During the sprint, the development team works collaboratively to implement the selected
user stories.
Daily stand-up meetings are held to discuss progress, address any issues, and plan the
day's work.
The development team follows the Agile principles and values, focusing on delivering
working software increments.
The hardware and software requirements for the Social media System include:
Hardware: A web server to host the application, database server to store user data and blog
posts, and network infrastructure for connectivity.
Software: Web development tools such as HTML, CSS, JavaScript, PHP, and a database
management system like MySQL. Additionally, a web browser for accessing the system.
Use cases describe interactions between actors (users) and the system. They represent specific
actions or tasks performed within the system. Examples of use cases for the Online Blogging
System include:
1. Create an Account
2. Log in
3. Create a Post
4. Edit a Post
5. Delete a Post
6. Comment on a Post
7. View Posts
8. Search for Posts
9. Filter Posts by Category or Tag
YourThoughts 13
Requirement Analysis 2022 - 2023
2.7 Use Case Diagram: The use case diagram for the system will illustrate the various use
cases and how they relate to each other.
YourThoughts 14
Design 2022 - 2023
Chapter-3
Design
User Registration:
User navigates to the website's registration page.
User enters their personal details, such as name, email address, and password.
User agrees to the terms and conditions and completes the registration process.
The system validates the user's information and creates a new account.
User receives a confirmation email to verify their account.
Posting Content:
User composes a new post or status update.
User adds text, images, videos, or links to the post.
User selects the desired privacy settings for the post (e.g., public, friends-only, specific
groups).
User publishes the post, and the system displays it on their profile and the appropriate
news feeds.
YourThoughts 15
Design 2022 - 2023
User can like or react to the post or comments to express their appreciation or agreement.
User can share the post on their own profile or with specific groups or individuals.
YourThoughts 16
Design 2022 - 2023
3.2 Diagrams:
UML (Unified Modeling Language) and DFD (Data Flow Diagram) are graphical
representations used to depict system architecture and information flow. For the Online Blogging
System, a UML class diagram can be created to illustrate the relationships between
classes/entities, while a DFD can show the flow of data within the system.
YourThoughts 17
Design 2022 - 2023
YourThoughts 18
Design 2022 - 2023
YourThoughts 19
Design 2022 - 2023
An Entity Relationship Diagram (ERD) represents the entities, relationships, and attributes in a
system. It visualizes the structure of the database and how different entities are related to each
other. An ERD for the Online Blogging System would include entities like users, blog posts,
comments, categories, and tags, along with their respective attributes and relationships.
YourThoughts ER-Daigram :
Fig.5- ER-Daigram
YourThoughts 20
Design 2022 - 2023
A data dictionary provides a detailed description of the data elements used in the system,
including their names, definitions, data types, and any additional constraints. For the Online
Blogging System, the data dictionary would include entries for entities like users, blog posts,
comments, categories, and tags, specifying their attributes and characteristics.
YourThoughts 21
Design 2022 - 2023
YourThoughts 22
Design 2022 - 2023
YourThoughts 23
Design 2022 - 2023
YourThoughts 24
Implementation 2022 - 2023
Chapter-4
Implementation
Login page
YourThoughts 25
Implementation 2022 - 2023
Signup page
YourThoughts 26
Implementation 2022 - 2023
User profile
YourThoughts 27
Implementation 2022 - 2023
YourThoughts 28
Implementation 2022 - 2023
Notification Area
YourThoughts 29
Implementation 2022 - 2023
A coding convention is a set of guidelines and standards that define how code should be written
and formatted in a consistent and readable manner. Following a coding convention is important
for ensuring code quality, maintainability, and collaboration among developers. Here are some
common coding conventions:
Naming Conventions:
Use meaningful and descriptive names for variables, functions, classes, and other code elements.
Follow a consistent naming style, such as camelCase, snake_case, or PascalCase.
Avoid using single-letter variable names or ambiguous abbreviations.
YourThoughts 30
Implementation 2022 - 2023
4.4 Code:
include 'core/init.php';
$user_id = $_SESSION['user_id'];
$user = User::getData($user_id);
$who_users = Follow::whoToFollow($user_id);
$notify_count = User::CountNotification($user_id);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Settings | YourThoughts</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/all.min.css">
</head>
YourThoughts 31
Implementation 2022 - 2023
<body>
<div id="mine">
<div class="wrapper-left">
<div class="sidebar-left">
<div class="grid-sidebar" style="margin-top: 12px">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "logopic2.jpg"; ?>" alt="" style=" height:30px;
width:200px; " />
</div>
</div>
<a href="home.php">
<div class="grid-sidebar bg-active" style="margin-top: 12px">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "/includes/icons/tweethome.png"; ?>" alt=""
height="26.25px" width="26.25px" />
</div>
<div class="wrapper-left-elements">
<a href="home.php" style="margin-top: 4px;"><strong>Home</strong></a>
</div>
</div>
</a>
<a href="notification.php">
<div class="grid-sidebar">
<div class="icon-sidebar-align position-relative">
<?php if ($notify_count > 0) { ?>
<i class="notify-count"><?php echo $notify_count; ?></i>
<?php } ?>
<img
src="<?php echo BASE_URL . "/includes/icons/tweetnotif.png"; ?>"
alt=""
height="26.25px"
width="26.25px"
/>
</div>
<div class="wrapper-left-elements">
<a href="notification.php" style="margin-top:
4px"><strong>Notifications</strong></a>
</div>
YourThoughts 32
Implementation 2022 - 2023
</div>
</a>
<div class="wrapper-left-elements">
<!-- <a href="/twitter/<?php echo $user->username; ?>" style="margin-top:
4px"><strong>Profile</strong></a> -->
<a href="<?php echo BASE_URL . $user->username; ?>" style="margin-top:
4px"><strong>Profile</strong></a>
</div>
</div>
</a>
<a href="<?php echo BASE_URL . "account.php"; ?>">
<div class="grid-sidebar ">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "/includes/icons/tweetsetting.png"; ?>" alt=""
height="26.25px" width="26.25px" />
</div>
<div class="wrapper-left-elements">
<a class="wrapper-left-active" href="<?php echo BASE_URL . "account.php"; ?>"
style="margin-top: 4px"><strong>Settings</strong></a>
</div>
</div>
</a>
<a href="includes/logout.php">
<div class="grid-sidebar">
<div class="icon-sidebar-align">
<i style="font-size: 26px;" class="fas fa-sign-out-alt"></i>
</div>
<div class="wrapper-left-elements">
<a href="includes/logout.php" style="margin-top: 4px"><strong>Logout</strong></a>
</div>
</div>
YourThoughts 33
Implementation 2022 - 2023
</a>
<button class="button-twittear">
<strong>Post</strong>
</button>
<div class="box-user">
<div class="grid-user">
<div>
<img
src="assets/images/users/<?php echo $user->img ?>"
alt="user"
class="img-user"
/>
</div>
<div>
<p class="name"><strong><?php if($user->name !== null) {
echo $user->name; } ?></strong></p>
<p class="username">@<?php echo $user->username; ?></p>
</div>
<div class="mt-arrow">
<img
src="https://i.ibb.co/mRLLwdW/arrow-down.png"
alt=""
height="18.75px"
width="18.75px"
/>
</div>
</div>
</div>
</div>
</div>
<div class="grid-posts">
<div class="border-right">
<div class="grid-toolbar-center">
<div class="center-input-search">
</div>
</div>
YourThoughts 34
Implementation 2022 - 2023
</div>
<div class="tab-content" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-
labelledby="v-pills-home-tab">
<!-- Change EMAIL and USAERNAME Form -->
<?php if (isset($_SESSION['errors_account'] )) {
?>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Username</label>
<input type="text" name="username" value="<?php echo $user->username; ?>"
class="form-control" id="exampleInputPassword1" placeholder="Username">
YourThoughts 35
Implementation 2022 - 2023
</div>
<div class="text-center">
</form>
</div>
<div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-
pills-profile-tab">
?>
<script>
$(document).ready(function(){
// Open modal on page load
$("#v-pills-profile-tab").click();
});
</script>
<div class="form-group">
YourThoughts 36
Implementation 2022 - 2023
</div>
<div class="form-group">
<label for="exampleInputPassword1">New Password</label>
<input type="password" name="new_password" class="form-control"
id="exampleInputPassword1" placeholder="New Password">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Verify Password</label>
<input type="password" name="ver_password" class="form-control"
id="exampleInputPassword1" placeholder="New Password">
</div>
<div class="text-center">
</form>
</div>
</div>
</div>
</div>
</div>
<div>
YourThoughts 37
Implementation 2022 - 2023
</div>
</div>
</div>
<div class="box-share">
<p class="txt-share"><strong>Who to follow</strong></p>
<?php
foreach($who_users as $user) {
// $u = User::getData($user->user_id);
$user_follow = Follow::isUserFollow($user_id , $user->id) ;
?>
<div class="grid-share">
<a style="position: relative; z-index:5; color:black" href="<?php echo $user-
>username; ?>">
<img
src="assets/images/users/<?php echo $user->img; ?>"
alt=""
class="img-share"
/>
</a>
<div>
<p>
<a style="position: relative; z-index:5; color:black" href="<?php echo $user-
>username; ?>">
<strong><?php echo $user->name; ?></strong>
</a>
</p>
<p class="username">@<?php echo $user->username; ?>
<?php if (Follow::FollowsYou($user->id , $user_id)) { ?>
<span class="ml-1 follows-you">Follows You</span></p>
<?php } ?></p></p>
</div>
<div>
<button class="follow-btn follow-btn-m
<?= $user_follow ? 'following' : 'follow' ?>"
data-follow="<?php echo $user->id; ?>"
data-user="<?php echo $user_id; ?>"
data-profile="<?php echo $u_id; ?>"
style="font-weight: 700;">
YourThoughts 38
Implementation 2022 - 2023
<?php }?>
</div>
</div>
</div> </div>
<script src="assets/js/search.js"></script>
<script src="assets/js/follow.js"></script>
<script src="https://kit.fontawesome.com/38e12cc51b.js"
crossorigin="anonymous"></script>
<!-- <script src="assets/js/jquery-3.4.1.slim.min.js"></script> -->
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
</body>
<style>
.container {
padding-left: 55px;
}
</style>
</html>
YourThoughts 39
Implementation 2022 - 2023
include 'core/init.php';
$user_id = $_SESSION['user_id'];
$user = User::getData($user_id);
$tweets = Tweet::tweets($user_id);
$who_users = Follow::whoToFollow($user_id);
$notify_count = User::CountNotification($user_id);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
YourThoughts 40
Implementation 2022 - 2023
<title>Home | YourThoughts</title>
</head>
<body>
<!-- This is a modal for welcome the new signup account! -->
<script src="assets/js/jquery-3.5.1.min.js"></script>
});
</script>
YourThoughts 41
Implementation 2022 - 2023
</div>
<p>This is developed by <span style="font-weight: 700;">Ahmad Raza</span>hi</p>
<p>The project includes post , repost , quote or even quote the quoted article , like post and
nested comments.
You can mention or add hashtag to yout post , change password or username.
Follow or unfollow people. get notificaction if any action happen. Search users by name or
username. and more!
</p>
<p>By default you followed
<a style="color:#207ce5;" href="codeastro"></a>
to see their posts.</p>
</div>
</div>
</div>
</div>
<div id="mine">
<div class="wrapper-left">
<div class="sidebar-left">
<div class="grid-sidebar" style="margin-top: 12px">
<div class="icon-sidebar-align">
<img class="Ahmad" src="<?php echo BASE_URL . "logopic2.jpg"; ?>" alt="" style="
height:30px; width:200px; "/>
</div>
</div>
<a href="home.php">
<div class="grid-sidebar bg-active" style="margin-top: 12px">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "/includes/icons/tweethome.png"; ?>" alt=""
height="26.25px" width="26.25px" />
</div>
<div class="wrapper-left-elements">
<a class="wrapper-left-active" href="home.php" style="margin-top:
4px;"><strong>Home</strong></a>
</div>
</div>
YourThoughts 42
Implementation 2022 - 2023
</a>
<a href="notification.php">
<div class="grid-sidebar">
<div class="icon-sidebar-align position-relative">
<?php if ($notify_count > 0) { ?>
<i class="notify-count"><?php echo $notify_count; ?></i>
<?php } ?>
<img
src="<?php echo BASE_URL . "/includes/icons/tweetnotif.png"; ?>"
alt=""
height="26.25px"
width="26.25px"
/>
</div>
<div class="wrapper-left-elements">
<a href="notification.php" style="margin-top:
4px"><strong>Notifications</strong></a>
</div>
</div>
</a>
<div class="wrapper-left-elements">
<!-- <a href="/twitter/<?php echo $user->username; ?>" style="margin-top:
4px"><strong>Profile</strong></a> -->
<a href="<?php echo BASE_URL . $user->username; ?>" style="margin-top:
4px"><strong>Profile</strong></a>
</div>
</div>
</a>
<a href="<?php echo BASE_URL . "account.php"; ?>">
<div class="grid-sidebar ">
<div class="icon-sidebar-align">
YourThoughts 43
Implementation 2022 - 2023
<div class="wrapper-left-elements">
<a href="<?php echo BASE_URL . "account.php"; ?>" style="margin-top:
4px"><strong>Settings</strong></a>
</div>
</div>
</a>
<a href="includes/logout.php">
<div class="grid-sidebar">
<div class="icon-sidebar-align">
<i style="font-size: 26px;" class="fas fa-sign-out-alt"></i>
</div>
<div class="wrapper-left-elements">
<a href="includes/logout.php" style="margin-top: 4px"><strong>Logout</strong></a>
</div>
</div>
</a>
<button class="button-twittear">
<strong>Post</strong>
</button>
<div class="box-user">
<div class="grid-user">
<div>
<img
src="assets/images/users/<?php echo $user->img ?>"
alt="user"
class="img-user"
/>
</div>
<div>
<p class="name"><strong><?php if($user->name !== null) {
echo $user->name; } ?></strong></p>
<p class="username">@<?php echo $user->username; ?></p>
</div>
<div class="mt-arrow">
<img
src="https://i.ibb.co/mRLLwdW/arrow-down.png"
YourThoughts 44
Implementation 2022 - 2023
alt=""
height="18.75px"
width="18.75px"
/>
</div>
</div>
</div>
</div>
</div>
<div class="grid-posts">
<div class="border-right">
<div class="grid-toolbar-center">
<div class="center-input-search">
<div class="input-group-login" id="whathappen">
<div class="container">
<div class="part-1">
<div class="header">
<div class="home">
<h2>Home</h2>
</div>
<!-- <div class="icon">
<button type="button" name="button">+</button>
</div> -->
</div>
<div class="text">
<form class="" action="handle/handleTweet.php" method="post"
enctype="multipart/form-data">
<div class="inner">
<label>
</label>
</div>
YourThoughts 45
Implementation 2022 - 2023
</div>
</div>
<div class="bottom">
<div class="bottom-container">
</div>
<div class="hash-box">
</ul>
</div>
<?php if (isset($_SESSION['errors_tweet'])) {
YourThoughts 46
Implementation 2022 - 2023
</div>
</div>
</div>
</div>
<!-- <div class="mt-icon-settings">
<img src="https://i.ibb.co/W5T9ycN/settings.png" alt="" />
</div> -->
</div>
<div class="box-fixed" id="box-fixed"></div>
</div>
<div class="wrapper-right">
<div style="width: 90%;" class="container">
</div>
</div>
</div>
YourThoughts 47
Implementation 2022 - 2023
if (!$profileData)
header('location: index.php');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> <?php echo $profileData->name; ?> (@<?php echo $profileData->username; ?>) |
Twitter</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/profile_style.css?v=<?php echo time(); ?>">
</head>
<body>
YourThoughts 48
Implementation 2022 - 2023
<script src="assets/js/jquery-3.5.1.min.js"></script>
<div id="mine">
<div class="wrapper-left">
<div class="sidebar-left">
<div class="grid-sidebar" style="margin-top: 12px">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "logopic2.jpg"; ?>" alt="" style=" height:30px;
width:200px; " />
</div>
</div>
<a href="home.php">
<div class="grid-sidebar bg-active" style="margin-top: 12px">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "/includes/icons/tweethome.png"; ?>" alt=""
height="26.25px" width="26.25px" />
</div>
<div class="wrapper-left-elements">
<a href="home.php" style="margin-top: 4px;"><strong>Home</strong></a>
</div>
</div>
</a>
<a href="notification.php">
<div class="grid-sidebar">
<div class="icon-sidebar-align position-relative">
<?php if ($notify_count > 0) { ?>
<i class="notify-count"><?php echo $notify_count; ?></i>
<?php } ?>
<img
src="<?php echo BASE_URL . "/includes/icons/tweetnotif.png"; ?>"
alt=""
height="26.25px"
width="26.25px"
/>
</div>
<div class="wrapper-left-elements">
<a href="notification.php" style="margin-top:
4px"><strong>Notifications</strong></a>
</div>
YourThoughts 49
Implementation 2022 - 2023
</div>
</a>
<div class="wrapper-left-elements">
<!-- <a href="/twitter/<?php echo $user->username; ?>" style="margin-top:
4px"><strong>Profile</strong></a> -->
<a class="wrapper-left-active" href="<?php echo BASE_URL . $user->username;
?>" style="margin-top: 4px"><strong>Profile</strong></a>
</div>
</div>
</a>
<a href="<?php echo BASE_URL . "account.php"; ?>">
<div class="grid-sidebar ">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "/includes/icons/tweetsetting.png"; ?>" alt=""
height="26.25px" width="26.25px" />
</div>
<div class="wrapper-left-elements">
<a href="<?php echo BASE_URL . "account.php"; ?>" style="margin-top:
4px"><strong>Settings</strong></a>
</div>
</div>
</a>
<a href="includes/logout.php">
<div class="grid-sidebar">
<div class="icon-sidebar-align">
<i style="font-size: 26px;" class="fas fa-sign-out-alt"></i>
</div>
<div class="wrapper-left-elements">
<a href="includes/logout.php" style="margin-top: 4px"><strong>Logout</strong></a>
</div>
</div>
YourThoughts 50
Implementation 2022 - 2023
</a>
<button class="button-twittear">
<strong>Tweet</strong>
</button>
<div class="box-user">
<div class="grid-user">
<div>
<img
src="assets/images/users/<?php echo $user->img ?>"
alt="user"
class="img-user"
/>
</div>
<div>
<p class="name"><strong><?php if($user->name !== null) {
echo $user->name; } ?></strong></p>
<p class="username">@<?php echo $user->username; ?></p>
</div>
<div class="mt-arrow">
<img
src="https://i.ibb.co/mRLLwdW/arrow-down.png"
alt=""
height="18.75px"
width="18.75px"
/>
</div>
</div>
</div>
</div>
</div>
<div class="grid-posts">
<div class="border-right">
<div class="grid-toolbar-center">
<div class="center-input-search">
</div>
</div>
YourThoughts 51
Implementation 2022 - 2023
<div class="col-md-12">
<img class="w-100 home-img-cover" src="assets/images/users/<?php echo
$profileData->imgCover; ?>" alt="">
</div>
</div>
YourThoughts 52
Implementation 2022 - 2023
<div>
<h5 class="modal-title d-inline" id="exampleModalLongTitle">Edit
Profile</h5>
</div>
<div>
</div>
<!-- <span aria-hidden="true">×</span> -->
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="image-upload">
<label for="cover-input">
<i style="top: 80px;
left:200px;
color:white;
font-size:18px " class="far fa-images position-absolute"></i>
</label>
<input id="cover-input" type="file" name="cover"/>
<a href="handle/handleDeleteCover.php" style="top: 80px;
left:260px;
color:red;
font-size:18px " class="fas fa-times position-absolute"></a>
<div class="image-upload">
<label for="file-input">
<i style="top: 240px;
left:100px;
YourThoughts 53
Implementation 2022 - 2023
color:white;
font-size:18px;
z-index:20 " class="far fa-images position-absolute"></i>
</label>
<input id="file-input" name="image" type="file"/>
</div>
</div>
<!-- <form class="" action=""> -->
<?php if (isset($_SESSION['errors'] )) { ?>
<script>
$(document).ready(function(){
// Open modal on page load
$("#edit").modal('show');
});
</script>
<?php foreach ($_SESSION['errors'] as $error) { ?>
<div class="alert alert-danger" role="alert">
<p style="font-size: 15px;" class="text-center"> <?php echo $error ;
?> </div> <?php } }
unset($_SESSION['errors']) ?> </p>
<div class="form-group">
<input type="text" name="name" class="form-control"
id="exampleInputEmail1" value="<?php echo $user->name; ?>" aria-describedby="emailHelp"
placeholder="Name">
</div>
<div class="form-group">
<input type="text" name="bio" class="form-control"
id="exampleInputEmail1" value="<?php if ($user->bio !== null)
echo $user->bio ;?>" aria-describedby="emailHelp" placeholder="Bio">
</div>
<div class="form-group">
YourThoughts 54
Implementation 2022 - 2023
</div>
<div class="form-group">
</div>
</div>
</div>
<!-- End Edit Modal -->
<?php } else {
$user_follow = Follow::isUserFollow($user_id , $profileData->id) ;
?>
<button class=" follow-btn
<?= $user_follow ? 'following' : 'follow' ?>"
data-follow="<?php echo $profileData->id; ?>">
<?php if($user_follow) { ?>
Following
<?php } else { ?>
Follow
<?php } ?>
</button>
<?php } ?>
</div>
<div class="home-title">
<h4><?php echo $profileData->name; ?></h4>
<p class="user-handle" style="color: gray;">@<?php echo $profileData->username;
?>
<?php if (Follow::FollowsYou($profileData->id , $user_id)) { ?>
<span class="ml-1 follows-you">Follows You</span></p>
<?php } ?>
YourThoughts 55
Implementation 2022 - 2023
</div>
<div class="row home-follow ml-2 mt-1">
<div class="col-md-3">
<div class="count-following-i"
data-follow = "<?php echo $profileData->id; ?>" >
<span class="home-follow-count count-following"><?php echo
Follow::countFollowing($profileData->id); ?></span> Followings</div>
</div>
<div class="col-md-3">
<div class="count-followers-i"
data-follow = "<?php echo $profileData->id; ?>">
<span class="home-follow-count count-followers"><?php echo
Follow::countFollowers($profileData->id); ?></span> Followers</div>
</div>
</div>
<div class="popupUsers">
</div>
YourThoughts 56
Implementation 2022 - 2023
Posts</a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab"
aria-controls="profile" aria-selected="false">
Media</a>
</li>
<li class="nav-item">
<a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact"
role="tab" aria-controls="contact" aria-selected="false">
Likes</a>
</li>
</ul>
</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-
tab">
<?php
$tweets = $media_tweets;
include 'includes/tweets.php'; ?>
</div>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-
tab">
<?php
$tweets = $liked_tweets;
include 'includes/tweets.php'; ?>
</div>
</div>
</div>
</div>
</div>
<div class="wrapper-right">
<div style="width: 90%;" class="container">
YourThoughts 57
Implementation 2022 - 2023
</div>
</div>
</div>
<div class="box-share">
<p class="txt-share"><strong>Who to follow</strong></p>
<?php
foreach($who_users as $user) {
// $u = User::getData($user->user_id);
$user_follow = Follow::isUserFollow($user_id , $user->id) ;
?>
<div class="grid-share">
<a style="position: relative; z-index:5; color:black" href="<?php echo $user-
>username; ?>">
<img
src="assets/images/users/<?php echo $user->img; ?>"
alt=""
class="img-share"
/>
</a>
<div>
<p>
<a style="position: relative; z-index:5; color:black" href="<?php echo $user-
>username; ?>">
<strong><?php echo $user->name; ?></strong>
</a>
</p>
<p class="username">@<?php echo $user->username; ?>
<?php if (Follow::FollowsYou($user->id , $user_id)) { ?>
<span class="ml-1 follows-you">Follows You</span></p>
<?php } ?></p></p>
</div>
<div>
<button class="follow-btn follow-btn-m
<?= $user_follow ? 'following' : 'follow' ?>"
YourThoughts 58
Implementation 2022 - 2023
<?php }?>
</div>
</div>
</div> </div>
<script src="assets/js/search.js"></script>
<script src="assets/js/photo.js"></script>
<script src="assets/js/follow.js?v=<?php echo time(); ?>"></script>
<script src="assets/js/users.js?v=<?php echo time(); ?>"></script>
<script type="text/javascript" src="assets/js/hashtag.js"></script>
<script type="text/javascript" src="assets/js/like.js"></script>
<script type="text/javascript" src="assets/js/comment.js?v=<?php echo time();
?>"></script>
<script type="text/javascript" src="assets/js/retweet.js?v=<?php echo time();
?>"></script>
<script src="https://kit.fontawesome.com/38e12cc51b.js"
crossorigin="anonymous"></script>
<!-- <script src="assets/js/jquery-3.4.1.slim.min.js"></script> -->
<script src="assets/js/jquery-3.5.1.min.js"></script>
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
</body>
<style>
YourThoughts 59
Implementation 2022 - 2023
.container {
padding-left: 55px;
}
</style>
</html>
<?php
include 'core/init.php';
$user_id = $_SESSION['user_id'];
$user = User::getData($user_id);
$tweet_id = $_GET['post_id'];
$tweet = Tweet::getData($tweet_id);
$who_users = Follow::whoToFollow($user_id);
$notify_count = User::CountNotification($user_id);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Status | YourThoughts</title>
<base href="<?php echo BASE_URL; ?>">
<link rel="shortcut icon" type="image/png" href="logopic2.jpg">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/home_style.css?v=<?php echo time(); ?>">
</head>
<body>
<script src="assets/js/jquery-3.5.1.min.js"></script>
YourThoughts 60
Implementation 2022 - 2023
<div id="mine">
<div class="wrapper-left">
<div class="sidebar-left">
<div class="grid-sidebar" style="margin-top: 12px">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "logopic2.jpg"; ?>" alt="" style=" height:30px;
width:200px; "/>
</div>
</div>
<a href="home.php">
<div class="grid-sidebar bg-active" style="margin-top: 12px">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "/includes/icons/tweethome.png"; ?>" alt=""
height="26.25px" width="26.25px" />
</div>
<div class="wrapper-left-elements">
<a class="wrapper-left-active" href="home.php" style="margin-top:
4px;"><strong>Home</strong></a>
</div>
</div>
</a>
<a href="notification.php">
<div class="grid-sidebar">
<div class="icon-sidebar-align position-relative">
<?php if ($notify_count > 0) { ?>
<i class="notify-count"><?php echo $notify_count; ?></i>
<?php } ?>
<img
src="<?php echo BASE_URL . "/includes/icons/tweetnotif.png"; ?>"
alt=""
height="26.25px"
width="26.25px"
/>
</div>
<div class="wrapper-left-elements">
<a href="notification.php" style="margin-top:
4px"><strong>Notifications</strong></a>
</div>
</div>
</a>
YourThoughts 61
Implementation 2022 - 2023
<div class="wrapper-left-elements">
<!-- <a href="/twitter/<?php echo $user->username; ?>" style="margin-top:
4px"><strong>Profile</strong></a> -->
<a href="<?php echo BASE_URL . $user->username; ?>" style="margin-top:
4px"><strong>Profile</strong></a>
</div>
</div>
</a>
<a href="<?php echo BASE_URL . "account.php"; ?>">
<div class="grid-sidebar ">
<div class="icon-sidebar-align">
<img src="<?php echo BASE_URL . "/includes/icons/tweetsetting.png"; ?>" alt=""
height="26.25px" width="26.25px" />
</div>
<div class="wrapper-left-elements">
<a href="<?php echo BASE_URL . "account.php"; ?>" style="margin-top:
4px"><strong>Settings</strong></a>
</div>
</div>
</a>
<a href="includes/logout.php">
<div class="grid-sidebar">
<div class="icon-sidebar-align">
<i style="font-size: 26px;" class="fas fa-sign-out-alt"></i>
</div>
<div class="wrapper-left-elements">
<a href="includes/logout.php" style="margin-top: 4px"><strong>Logout</strong></a>
</div>
</div>
</a>
<button class="button-twittear">
YourThoughts 62
Implementation 2022 - 2023
<strong>Tweet</strong>
</button>
<div class="box-user">
<div class="grid-user">
<div>
<img
src="assets/images/users/<?php echo $user->img ?>"
alt="user"
class="img-user"
/>
</div>
<div>
<p class="name"><strong><?php if($user->name !== null) {
echo $user->name; } ?></strong></p>
<p class="username">@<?php echo $user->username; ?></p>
</div>
<div class="mt-arrow">
<img
src="https://i.ibb.co/mRLLwdW/arrow-down.png"
alt=""
height="18.75px"
width="18.75px"
/>
</div>
</div>
</div>
</div>
</div>
<div class="grid-posts">
<div class="border-right">
<div class="grid-toolbar-center">
<div class="center-input-search">
<div class="row">
<div class="col-xs-1">
<!-- history go to the perv page and specific section user come from -->
YourThoughts 63
Implementation 2022 - 2023
</div>
</div>
<div class="part-2">
</div>
</div>
</div>
<!-- <div class="mt-icon-settings">
<img src="https://i.ibb.co/W5T9ycN/settings.png" alt="" />
</div> -->
</div>
<?php
$retweet_sign = false;
$retweet_comment =false;
$qoq = false;
if (Tweet::isTweet($tweet->id)) {
$tweet_user = User::getData($tweet->user_id) ;
$tweet_real = Tweet::getTweet($tweet->id);
$timeAgo = Tweet::getTimeAgo($tweet->post_on) ;
$likes_count = Tweet::countLikes($tweet->id) ;
$user_like_it = Tweet::userLikeIt($user_id ,$tweet->id);
$retweets_count = Tweet::countRetweets($tweet->id) ;
$user_retweeted_it = Tweet::userRetweeetedIt($user_id ,$tweet->id);
YourThoughts 64
Implementation 2022 - 2023
} else if (Tweet::isRetweet($tweet->id)) {
$retweet = Tweet::getRetweet($tweet->id);
if ($retweet->retweet_msg == null) {
if ($retweet->retweet_id == null) {
$retweeted_tweet = Tweet::getRetweet($retweet->retweet_id);
if($retweeted_tweet->tweet_id != null) {
// here it's retweeted quoted
// if($retweeted_tweet->)
$tweet_user = User::getData($retweeted_tweet->user_id) ;
$timeAgo = Tweet::getTimeAgo($retweeted_tweet->post_on) ;
$likes_count = Tweet::countLikes($retweeted_tweet->post_id) ;
$user_like_it = Tweet::userLikeIt($user_id ,$retweeted_tweet->post_id);
$retweets_count = Tweet::countRetweets($retweeted_tweet->post_id) ;
$user_retweeted_it = Tweet::userRetweeetedIt($user_id ,$retweeted_tweet-
>post_id);
$tweet_inner = Tweet::getTweet($retweeted_tweet->tweet_id);
$user_inner_tweet = User::getData($tweet_inner->user_id) ;
$timeAgo_inner = Tweet::getTimeAgo($tweet_inner->post_on);
$retweeted_user = User::getData($tweet->user_id);
$retweet_sign = true;
YourThoughts 65
Implementation 2022 - 2023
$qoute = $retweeted_tweet->retweet_msg;
$retweet_comment = true;
} else {
// here is retweeted quoted of quoted
$retweet_sign = true;
$tweet_user = User::getData($retweeted_tweet->user_id) ;
$timeAgo = Tweet::getTimeAgo($retweeted_tweet->post_on) ;
$likes_count = Tweet::countLikes($retweeted_tweet->post_id) ;
$user_like_it = Tweet::userLikeIt($user_id ,$retweeted_tweet->post_id);
$retweets_count = Tweet::countRetweets($retweeted_tweet->post_id) ;
$user_retweeted_it = Tweet::userRetweeetedIt($user_id ,$retweeted_tweet-
>post_id);
$retweeted_user = User::getData($tweet->user_id);
}
}
} else {
// quote tweet condtion
if ($retweet->retweet_id == null) {
$tweet_user = User::getData($tweet->user_id) ;
$timeAgo = Tweet::getTimeAgo($tweet->post_on) ;
$likes_count = Tweet::countLikes($tweet->id) ;
$user_like_it = Tweet::userLikeIt($user_id ,$tweet->id);
$retweets_count = Tweet::countRetweets($tweet->id) ;
$user_retweeted_it = Tweet::userRetweeetedIt($user_id ,$tweet->id);
$qoute = $retweet->retweet_msg;
$retweet_comment = true;
$tweet_inner = Tweet::getTweet($retweet->tweet_id);
YourThoughts 66
Implementation 2022 - 2023
$user_inner_tweet = User::getData($tweet_inner->user_id) ;
$timeAgo_inner = Tweet::getTimeAgo($tweet_inner->post_on);
} else {
// this condtion for quote of quote which retweet_id not null and retweet msg not null
$tweet_user = User::getData($tweet->user_id) ;
$timeAgo = Tweet::getTimeAgo($tweet->post_on) ;
$likes_count = Tweet::countLikes($tweet->id) ;
$user_like_it = Tweet::userLikeIt($user_id ,$tweet->id);
$retweets_count = Tweet::countRetweets($tweet->id) ;
$user_retweeted_it = Tweet::userRetweeetedIt($user_id ,$tweet->id);
$qoute = $retweet->retweet_msg;
$qoq = true; // stand for quote of quote
$tweet_inner = Tweet::getRetweet($retweet->retweet_id);
$user_inner_tweet = User::getData($tweet_inner->user_id) ;
$timeAgo_inner = Tweet::getTimeAgo($tweet_inner->post_on);
$inner_qoute = $tweet_inner->retweet_msg;
if($inner_qoute == null) {
$tweet_innerr = Tweet::getRetweet($tweet_inner->retweet_id);
$inner_qoute = $tweet_innerr->retweet_msg;
// $inner_quote = "qork";
}
$tweet_link = $tweet->id;
if($retweet_sign)
$comment_count = Tweet::countComments($retweeted_tweet->id);
else $comment_count = Tweet::countComments($tweet->id);
YourThoughts 67
Implementation 2022 - 2023
?>
<div>
<p>
<a style="position: relative; z-index:1000; color:black" href="<?php echo $tweet_user-
>username; ?>">
<strong> <?php echo $tweet_user->name ?> </strong>
</a>
<span class="username-twitter">@<?php echo $tweet_user->username ?> </span>
<span class="username-twitter"><?php echo $timeAgo ?></span>
</p>
<p>
<?php
// check if it's quote or normal tweet
if ($retweet_comment || $qoq)
echo Tweet::getTweetLinks($qoute);
else echo Tweet::getTweetLinks($tweet_real->status); ?>
</p>
<?php if ($retweet_comment == false && $qoq == false) { ?>
YourThoughts 68
Implementation 2022 - 2023
<div>
<p>
<a style="position: relative; z-index:1000; color:black" href="<?php echo
$user_inner_tweet->username; ?>">
<strong> <?php echo $user_inner_tweet->name ?> </strong>
</a>
<span class="username-twitter">@<?php echo $user_inner_tweet->username ?>
</span>
<span class="username-twitter"><?php echo $timeAgo_inner ?></span>
</p>
<p>
<?php
if ($qoq)
echo Tweet::getTweetLinks($inner_qoute);
else echo Tweet::getTweetLinks($tweet_inner->status); ?>
</p>
YourThoughts 69
Implementation 2022 - 2023
Javascript Code:
$(function(){
$(document).on('click','.comment', function(){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
$counter = $(this).find(".likes-count");
$count = $counter.text();
$button = $(this);
console.log(tweet_id);
console.log(user_id);
$.post('core/ajax/comment.php', {showPopup:tweet_id,user_id:user_id}, function(data){
$('.popupComment').html(data);
$('.close-retweet-popup').click(function(){
$('.retweet-popup').hide();
})
});
});
YourThoughts 70
Implementation 2022 - 2023
// console.log(tweet_id);
// console.log(user_id);
// console.log(comment);
$.post('http://localhost/twitterclone/core/ajax/comment.php',
{qoute:tweet_id,user_id:user_id,comment:comment}, function(data){
$('.retweet-popup').hide();
$('.comments').html(data);
location.reload();
// $counter.text(data);
// $button.removeClass('retweet').addClass('retweeted');
});
});
$(document).on('click','.reply', function(){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
$counter = $(this).find(".likes-count");
$count = $counter.text();
$button = $(this);
console.log(tweet_id);
console.log(user_id);
$.post('http://localhost/twitterclone/core/ajax/comment.php',
{showReply:tweet_id,user_id:user_id}, function(data){
$('.popupComment').html(data);
YourThoughts 71
Implementation 2022 - 2023
$('.close-retweet-popup').click(function(){
$('.retweet-popup').hide();
})
});
});
// console.log(comment_id);
// console.log(user_id);
// console.log(comment);
$.post('http://localhost/twitterclone/core/ajax/comment.php',
{reply:comment_id,user_id:user_id,comment:comment}, function(data){
$('.retweet-popup').hide();
$('.comments').html(data);
location.reload();
// $counter.text(data);
// $button.removeClass('retweet').addClass('retweeted');
});
});
});
$(function(){
YourThoughts 72
Implementation 2022 - 2023
$(document).on('click','.follow-btn', function(e){
let follow_id = $(this).data('follow');
let user = $(this).data('user');
let profile = $(this).data('profile');
let following , followers;
$button = $(this);
if($button.hasClass('follow')) {
// alert(follow_id);
$.post('core/ajax/follow.php', {follow:follow_id}, function(data){
// alert(data);
$button.addClass('following');
$button.removeClass('follow');
$button.text("Following");
if (user == profile && profile != null) {
following = $('.count-following').html() ;
following++;
$('.count-following').html(following);
}
if (profile == null)
$('.count-followers').html(data);
// $counter.text(data);
// $button.removeClass('retweeted').addClass('retweet');
// $c.removeClass('retweeted-i').addClass('retweet-i');
});
} else {
$.post('core/ajax/follow.php', {unfollow:follow_id}, function(data){
$button.addClass('follow');
$button.removeClass('following');
$button.text("Follow");
// $counter.text(data);
YourThoughts 73
Implementation 2022 - 2023
// $button.removeClass('retweeted').addClass('retweet');
// $c.removeClass('retweeted-i').addClass('retweet-i');
});
}
});
$(this).html("Unfollow");
});
$(document).on('mouseout' , '.following' , function(e) {
$(this).html("Following");
});
});
$(function(){
$(document).on('click','.option', function(e){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
var retweeted_it = $(this).data('retweeted');
var status = $(this).data('status');
$counter = $(this).find(".likes-count");
$count = $counter.text();
$button = $(this);
$op = $(this).next();
// $op = $(this).find('.options');
var flag = $(this).data('tmp');
var sign = $(this).data('sign');
var qoq = $(this).data('qoq');
YourThoughts 74
Implementation 2022 - 2023
$.post('core/ajax/retweet.php', {option:tweet_id,user_id:user_id,retweeted:retweeted_it ,
sign:sign , tmp:flag,qoq:qoq , status:status}, function(data){
$op.html(data);
$(document).click(function(e){
if( $(e.target).closest('.options').length > 0 ) {
return false;
}
$('.retweet-div').hide();
})
});
$(document).one('click','.retweet-i', function(event){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
$c = $(this);
$.post('core/ajax/retweet.php', {retweet:tweet_id,user_id:user_id,isQoute:flag,qoq:qoq},
function(data){
// $('.popupTweet').html(data);
$counter.text(data);
$button.removeClass('retweet').addClass('retweeted');
$c.removeClass('retweet-i').addClass('retweeted-i');
$('.retweet-div').hide();
// $.ajax({
// url: 'http://localhost/twitterclone/home.php',
// success: function(data) {
// }
// });
YourThoughts 75
Implementation 2022 - 2023
location.reload();
});
});
$(document).one('click','.retweeted-i', function(event){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
var status = $(this).data('status');
$c = $(this);
event.stopImmediatePropagation();
console.log(tweet_id);
$.post('core/ajax/retweet.php', {unretweet:tweet_id,user_id:user_id}, function(data){
// if (data == 0)
// $counter.text('');
// else
$counter.text(data);
$button.removeClass('retweeted').addClass('retweet');
$c.removeClass('retweeted-i').addClass('retweet-i');
$('.retweet-div').hide();
if (!status)
location.reload();
else history.go(-1);
});
});
$(document).on('click','.qoute', function(){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
$counter = $(this).find(".likes-count");
$count = $counter.text();
YourThoughts 76
Implementation 2022 - 2023
$button = $(this);
// console.log(tweet_id);
// console.log($retweeted_it);
// console.log($sign);
$.post('core/ajax/retweet.php', {showPopup:tweet_id,user_id:user_id}, function(data){
$('.popupTweet').html(data);
$('.close-retweet-popup').click(function(){
$('.retweet-popup').hide();
})
});
});
});
event.stopImmediatePropagation();
console.log(tweet_id);
console.log(user_id);
console.log(comment);
$.post('core/ajax/retweet.php',
{qoute:tweet_id,user_id:user_id,comment:comment,isQoute:flag,qoq:qoq}, function(data){
$('.retweet-popup').hide();
location.reload();
// $counter.text(data);
YourThoughts 77
Implementation 2022 - 2023
// $button.removeClass('retweet').addClass('retweeted');
});
});
});
PhP Code:
<?php
include '../core/init.php';
require_once '../core/classes/validation/Validator.php';
use validation\Validator;
$email = $_POST['email'];
$password = $_POST['password'];
if(!empty($email) && !empty($password)) {
$email = User::checkInput($email);
$password = User::checkInput($password);
}
$v = new Validator;
$v->rules('email' , $email , ['required' , 'email']);
$v->rules('password' , $password , ['required' , 'string']);
$errors = $v->errors;
if($errors == []) {
User::login($email , $password);
if(User::login($email , $password) === false ) {
// $errors = 'the email or password is not correct';/
$_SESSION['errors'] = ['the email or password is not correct'];
header('location: ../index.php') ;
}
} else {
$_SESSION['errors'] = $errors;
header('location: ../index.php') ;
YourThoughts 78
Implementation 2022 - 2023
?>
<?php
include '../core/init.php';
require_once '../core/classes/validation/Validator.php';
use validation\Validator;
if (isset($_POST['signup'])) {
$email = $_POST['email'];
$name = $_POST['name'];
$password = $_POST['password'];
$username = $_POST['username'];
$v = new Validator;
$v->rules('name' , $name , ['required' , 'string' , 'max:20']);
$v->rules('username' , $username , ['required' , 'string' , 'max:20']);
$v->rules('email' , $email , ['required' , 'email']);
$v->rules('password' , $password , ['required' , 'string' , 'min:5']);
$errors = $v->errors;
if ($errors == []){
$username = str_replace(' ', '', $username);
YourThoughts 79
Implementation 2022 - 2023
}
} else {
$_SESSION['errors_signup'] = $errors;
header('location: ../index.php'); }
?>
<?php
include '../core/init.php';
require_once '../core/classes/validation/Validator.php';
use validation\Validator;
$user =User::getData($_SESSION['user_id']);
if (isset($_POST['submit'])) {
YourThoughts 80
Implementation 2022 - 2023
$email = User::checkInput($_POST['email']) ;
$username = User::checkInput($_POST['username']);
$v = new Validator;
$v->rules('username' , $username , ['required' , 'string' , 'max:20']);
$v->rules('email' , $email , ['required' , 'email']);
$errors = $v->errors;
if ($errors == []) {
} else {
$_SESSION['errors_account'] = $errors;
header('location: ../account.php');
?>
<?php
include '../core/init.php';
require_once '../core/classes/validation/Validator.php';
YourThoughts 81
Implementation 2022 - 2023
require_once '../core/classes/image.php';
use validation\Validator;
$username = User::getUserNameById($_SESSION['user_id']);
$user =User::getData($_SESSION['user_id']);
$currentImg = $user->img;
$currentCover = $user->imgCover;
if (isset($_POST['update'])) {
$name = User::checkInput($_POST['name']) ;
$bio = User::checkInput($_POST['bio']);
$website = User::checkInput($_POST['website']);
$location = User::checkInput($_POST['location']);
$cover = $_FILES['cover'];
$image = $_FILES['image'];
$v = new Validator;
$v->rules('name' , $name , ['required' , 'string' , 'max:20']);
$v->rules('bio' , $bio , ['string' , 'max:100']);
$v->rules('image' , $image , ['image']);
$v->rules('cover' , $cover , ['image']);
$errors = $v->errors;
if ($errors == []) {
YourThoughts 82
Implementation 2022 - 2023
// var_dump($userCover) ;
// echo "<br>";
// var_dump($userImg) ;
// die();
$data = [
'name' => $name ,
'bio' => $bio ,
'website' => $website ,
'location' => $location ,
'imgCover' => $userCover ,
'img' => $userImg ,
];
$img->upload();
}
if ($cover['name'] !== "") {
if ($currentCover !== 'cover.png')
unlink('../assets/images/users/' . $currentCover);
$coverImg->upload();
}
} else {
$_SESSION['errors'] = $errors;
header('location: ../' . $username);
YourThoughts 83
Implementation 2022 - 2023
?>
<?php
include '../core/init.php';
$username = User::getUserNameById($_SESSION['user_id']);
$user =User::getData($_SESSION['user_id']);
$currentCover = $user->imgCover;
YourThoughts 84
Implementation 2022 - 2023
$data = [
'imgCover' => 'cover.png' ,
];
if ($sign == true) {
header('location: ../' . $username);
} else header('location: ../' . $username);
?>
<?php
include 'core/init.php' ;
if (isset($_SESSION['user_id'])) {
header('location: home.php');
}
?>
<html>
<head>
<title>YourThoughts</title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/4.6.3/css/font-awesome.css"/>
<!-- <link rel="stylesheet" href="assets/css/style-complete.css"/> -->
<link rel="stylesheet" href="assets/css/index_style.css?v=<?php echo time(); ?>">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/all.min.css">
YourThoughts 85
Implementation 2022 - 2023
<body>
<main class="twt-main">
<section class="twt-login">
<?php include 'includes/login.php'; ?>
<div class="slow-login">
<img style=";" class="login-bird" src=" <?php echo BASE_URL .
"logopic2.jpg"; ?>" alt="bird">
<button class="login-small-display signin-btn pri-btn">Log in</button>
<span class="front-para">See what’s happening in the world right now</span>
<span class="join">Join YourThoughts Today.</span>
<button type="button" id="auto" onclick="" class="signup-btn pri-btn" data-
toggle="modal" data-target="#exampleModalCenter">
Sign Up</button>
</div>
</div>
</div>
</div>
</section>
<section class="twt-features">
<div class="features-div">
<img class="twt-icon" src='https://image.ibb.co/bzvrkp/search_icon.png'>
<p>Follow your interests.</p>
<img class="twt-icon" src="https://image.ibb.co/mZPTWU/heart_icon.png">
YourThoughts 86
Implementation 2022 - 2023
<script src="assets/js/jquery-3.4.1.slim.min.js"></script>
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/mine.js"></script>
</body>
</html>
$(function(){
$glo = this;
$(document).on('change','#file-input', function(e){
YourThoughts 87
Implementation 2022 - 2023
});
$(document).on('change','#cover-input', function(e){
});
$(document).on('change','#tweet_img', function(e){
console.log(this);
$glo = this;
if (this.files && this.files[0]) {
let reader = new FileReader();
reader.onload=function(e){
let container = document.querySelector(".upload-photo");
container.style.display = "block";
let image = document.querySelector(".img-upload-tmp");
image.src = e.target.result;
}
// alert("all right");
reader.readAsDataURL(this.files[0]);
this.files = null;
}
});
$(document).on('click','.upload-delete', function(e){
YourThoughts 88
Implementation 2022 - 2023
$(document).on('click','.option', function(e){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
var retweeted_it = $(this).data('retweeted');
var status = $(this).data('status');
$counter = $(this).find(".likes-count");
$count = $counter.text();
$button = $(this);
$op = $(this).next();
// $op = $(this).find('.options');
var flag = $(this).data('tmp');
var sign = $(this).data('sign');
var qoq = $(this).data('qoq');
$.post('core/ajax/retweet.php', {option:tweet_id,user_id:user_id,retweeted:retweeted_it ,
sign:sign , tmp:flag,qoq:qoq , status:status}, function(data){
$op.html(data);
$(document).click(function(e){
if( $(e.target).closest('.options').length > 0 ) {
return false;
}
$('.retweet-div').hide();
})
});
$(document).one('click','.retweet-i', function(event){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
$c = $(this);
YourThoughts 89
Implementation 2022 - 2023
$.post('core/ajax/retweet.php', {retweet:tweet_id,user_id:user_id,isQoute:flag,qoq:qoq},
function(data){
// $('.popupTweet').html(data);
$counter.text(data);
$button.removeClass('retweet').addClass('retweeted');
$c.removeClass('retweet-i').addClass('retweeted-i');
$('.retweet-div').hide();
// $.ajax({
// url: 'http://localhost/twitterclone/home.php',
// success: function(data) {
// }
// });
location.reload();
});
});
$(document).one('click','.retweeted-i', function(event){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
var status = $(this).data('status');
$c = $(this);
event.stopImmediatePropagation();
console.log(tweet_id);
$.post('core/ajax/retweet.php', {unretweet:tweet_id,user_id:user_id}, function(data){
// if (data == 0)
// $counter.text('');
// else
$counter.text(data);
YourThoughts 90
Implementation 2022 - 2023
$button.removeClass('retweeted').addClass('retweet');
$c.removeClass('retweeted-i').addClass('retweet-i');
$('.retweet-div').hide();
if (!status)
location.reload();
else history.go(-1);
});
});
$(document).on('click','.qoute', function(){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
$counter = $(this).find(".likes-count");
$count = $counter.text();
$button = $(this);
// console.log(tweet_id);
// console.log($retweeted_it);
// console.log($sign);
$.post('core/ajax/retweet.php', {showPopup:tweet_id,user_id:user_id}, function(data){
$('.popupTweet').html(data);
$('.close-retweet-popup').click(function(){
$('.retweet-popup').hide();
})
});
});
});
event.stopImmediatePropagation();
YourThoughts 91
Implementation 2022 - 2023
console.log(tweet_id);
console.log(user_id);
console.log(comment);
$.post('core/ajax/retweet.php',
{qoute:tweet_id,user_id:user_id,comment:comment,isQoute:flag,qoq:qoq}, function(data){
$('.retweet-popup').hide();
location.reload();
// $counter.text(data);
// $button.removeClass('retweet').addClass('retweeted');
});
});
});
$(function(){
$(document).on('click','.retweets-u', function(){
var tweet_id = $(this).data('tweet');
// console.log(tweet_id);
$('.close-retweet-popup').click(function(){
$('.retweet-popup').hide();
})
$(document).click(function(e){
if( $(e.target).closest('.retweet-popup-body-wrap').length > 0 ) {
return false;
}
YourThoughts 92
Implementation 2022 - 2023
$('.retweet-popup').hide();
})
});
});
$(document).on('click','.likes-u', function(){
var tweet_id = $(this).data('tweet');
// console.log(tweet_id);
$('.close-retweet-popup').click(function(){
$('.retweet-popup').hide();
})
$(document).click(function(e){
if( $(e.target).closest('.retweet-popup-body-wrap').length > 0 ) {
return false;
}
$('.retweet-popup').hide();
})
});
});
$(document).on('click','.count-following-i', function(){
var user_id = $(this).data('follow');
$('.close-retweet-popup').click(function(){
$('.retweet-popup').hide();
})
$(document).click(function(e){
if( $(e.target).closest('.retweet-popup-body-wrap').length > 0 ) {
return false;
}
YourThoughts 93
Implementation 2022 - 2023
$('.retweet-popup').hide();
})
});
});
$(document).on('click','.count-followers-i', function(){
var user_id = $(this).data('follow');
$('.close-retweet-popup').click(function(){
$('.retweet-popup').hide();
})
$(document).click(function(e){
if( $(e.target).closest('.retweet-popup-body-wrap').length > 0 ) {
return false;
}
$('.retweet-popup').hide();
})
});
});
$(document).on('click','.reply', function(){
var tweet_id = $(this).data('tweet');
var user_id = $(this).data('user');
$counter = $(this).find(".likes-count");
$count = $counter.text();
$button = $(this);
console.log(tweet_id);
console.log(user_id);
$.post('core/ajax/comment.php', {showReply:tweet_id,user_id:user_id}, function(data){
$('.popupComment').html(data);
YourThoughts 94
Implementation 2022 - 2023
$('.close-retweet-popup').click(function(){
$('.retweet-popup').hide();
})
});
});
});
<?php
YourThoughts 95
Implementation 2022 - 2023
$stmt->execute();
if ($stmt->rowCount() > 0) {
return true;
} else return false;
}
public static function usersFollowing($user_id){
return $stmt->fetchAll(PDO::FETCH_OBJ);
}
public static function usersFollowers($user_id){
return $stmt->fetchAll(PDO::FETCH_OBJ);
}
public static function whoToFollow($user_id){
$stmt = self::connect()->prepare("SELECT * FROM `users`
WHERE `id` != :user_id AND `id` NOT IN
(SELECT `following_id` FROM `follow` WHERE `follower_id` = :user_id) ORDER BY
rand() LIMIT 3");
// $stmt->execute(array("user_id" => $user_id));
$stmt->bindParam(":user_id", $user_id, PDO::PARAM_INT);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_OBJ);
}
public static function FollowsYou($profile_id , $user_id){
$stmt = self::connect()->prepare("SELECT * FROM `follow`
WHERE `follower_id` = :profile_id AND `following_id` = :user_id");
$stmt->bindParam(":user_id", $user_id, PDO::PARAM_INT);
$stmt->bindParam(":profile_id", $profile_id, PDO::PARAM_INT);
$stmt->execute();
if ($stmt->rowCount() > 0) {
YourThoughts 96
Implementation 2022 - 2023
return true;
} else return false;
}
}
<?php
class Image {
private $name;
private $tmp_name;
public $new_name;
protected $sign;
$this->name =$img['name'];
$this->tmp_name =$img['tmp_name'];
$ext = pathinfo($this->name)['extension'];
if ($tweet != null) {
$this->new_name = 'tweet-' . uniqid() . '.' . $ext ;
$this->sign = true;
} else $this->new_name = 'user-' . uniqid() . '.' . $ext ;
YourThoughts 97
Implementation 2022 - 2023
<?php
if ($stmt->rowCount() > 0) {
$_SESSION['user_id'] = $user->id;
header('location: ../home.php');
} else {return false; }
}
YourThoughts 98
Implementation 2022 - 2023
$pdo = self::connect();
$pdo->beginTransaction();
$stmt = $pdo->prepare("INSERT INTO `users` (`email` , `password` , `name` , `username`)
Values (:email , :password , :name , :username)");
YourThoughts 99
Implementation 2022 - 2023
'target' => 0,
'type' => 'follow' ,
'time' => date("Y-m-d H:i:s") ,
'count' => '0' ,
'status' => '0'
];
Tweet::create('notifications' , $data_notify);
$_SESSION['welcome'] = 'welcome';
header('location: ../home.php') ;
}
public static function update($table , $user_id , $fields = array()){
$colms = '';
$loopCount = 1;
// to know when i insert ','
foreach ($fields as $name => $value) {
$colms .= "`{$name}` = :{$name}";
if($loopCount < count($fields)) {
$colms .= ', ' ; }
$loopCount++;
}
$sql = "UPDATE {$table} SET {$colms} WHERE id = {$user_id}";
$pdo = self::connect();
if($stmt = $pdo->prepare($sql)) {
foreach($fields as $key => $data) {
$stmt->bindValue(':'. $key , $data );
}
$stmt->execute();
return true;
}
YourThoughts 100
Implementation 2022 - 2023
$stmt = self::connect()->prepare($sql);
$stmt->execute();
}
if ($stmt->rowCount() > 0) {
return true;
} else return false;
}
if ($stmt->rowCount() > 0) {
return true;
} else return false;
}
YourThoughts 101
Implementation 2022 - 2023
YourThoughts 102
Implementation 2022 - 2023
YourThoughts 103
Testing 2022 - 2023
Chapter-5
Testing
Testing a program consists of subjecting the program to a set of test inputs and observing if the
program behaves as expected then the condition under which failure occurs are noted for letter
debugging and correction.
Testing Principals: -
• Testing Schedule: An overall testing schedule and resource planning must be made well in
advance.
• The Pareto principle implies that 80% of all errors uncovered during testing will likely be
traceable to 20% of program modules.
• Testing scheduling begins “in small “ and progress towards testing “in the large”
YourThoughts 104
Testing 2022 - 2023
User Registration:
Test Case 1: Verify that a new user can successfully register with valid credentials.
Input: User provides a unique username, valid email address, password, and other
required details.
Expected Output: User account is created, and the user is redirected to the login page.
Test Case 2: Verify that an error is displayed when attempting to register with an existing
username or email.
Input: User provides a username or email address that is already registered in the system.
Expected Output: An error message is displayed indicating that the username or email is
already taken.
Test Case 3: Verify that all required fields are validated and appropriate error messages
are displayed for missing or invalid information.
Input: User tries to register without providing a username, email, or password, or enters
an invalid email format.
Expected Output: Error messages are displayed for each missing or invalid field,
prompting the user to correct the information.
YourThoughts 105
Testing 2022 - 2023
User Login:
Test Case 1: Verify that a registered user can log in with correct username and password.
Input: User enters the correct username and password.
Expected Output: User is successfully logged in and redirected to the home page.
Test Case 2: Verify that an error is displayed for invalid login credentials.
Input: User enters an incorrect username or password.
Expected Output: An error message is displayed indicating that the login credentials are
invalid.
YourThoughts 106
Testing 2022 - 2023
Post Creation:
Test Case 1: Verify that a logged-in user can create a new tweet with valid content.
Input: User enters a tweet message within the character limit.
Expected Output: The tweet is successfully posted and displayed in the user's feed.
Test Case 2: Verify that the tweet character limit is enforced correctly.
Input: User exceeds the maximum character limit while creating a tweet.
Expected Output: An error message is displayed indicating that the tweet exceeds the
character limit.
Test Case 3: Verify that appropriate error messages are displayed for empty or
excessively long tweets.
Input: User tries to post an empty tweet or a tweet with an extremely long content.
Expected Output: Error messages are displayed prompting the user to enter valid tweet
content.
YourThoughts 107
Testing 2022 - 2023
User Profile:
Verify that the user's profile page displays accurate information, including username
and bio.
Verify that the user's tweets and comments are correctly displayed on their profile
page.
Verify that the user's profile can be updated with new information.
YourThoughts 108
Future Enhancement 2022 - 2023
Chapter-6
Future Enhancement
6.-Future Enhancement
Multimedia Support: Enhance the social media website to support multimedia content, such as
images, videos, and GIFs. Users will be able to upload and share media files along with their
posts, providing a more engaging and visually appealing experience.
Real-Time Notifications: Implement real-time notification features to notify users about new
followers, likes, comments, and mentions. This enhancement will improve user engagement and
keep users updated with the latest activities and interactions on their profiles.
Advanced Search and Filtering: Enhance the search functionality to provide advanced search
and filtering options. Users will be able to search for specific keywords, filter results based on
different criteria (e.g., date, location, user), and refine their search queries to find relevant
content more efficiently.
Social Sharing Integration: Integrate social sharing capabilities with popular platforms like
Facebook, Twitter, and LinkedIn. Users will have the option to share their posts directly from the
social media website to other platforms, expanding their reach and allowing for broader content
distribution.
Customization and Theming: Provide users with the ability to customize their profile pages by
choosing different themes, color schemes, and layout options. This enhancement will allow users
to personalize their profiles and make their social media experience more unique.
Analytics and Insights: Incorporate analytics and insights features to provide users with data
about their post engagements, audience demographics, and overall social media presence. Users
will be able to track their performance, identify trends, and make informed decisions to improve
their content strategy.
Privacy and Security Enhancements: Strengthen the privacy and security measures of the
social media website by implementing features such as two-factor authentication, privacy
settings, and content moderation tools. This will enhance user trust, protect user data, and create
a safer online environment.
YourThoughts 109
Future Enhancement 2022 - 2023
Mobile App Development: Develop a mobile application for the social media website to offer a
seamless and optimized user experience on smartphones and tablets. The mobile app will allow
users to access and interact with the platform conveniently from their mobile devices.
These future enhancements will add value to the social media website, enhance user experience,
and provide additional features and capabilities to meet the evolving needs of the users.
YourThoughts 110
Bibliography 2022 - 2023
Chapter-6
Bibliography
7.- Bibliography:-
Websites Reference:
• https://getbootstrap.com/
• https://www.youtube.com
• https://www.geeksforgeeks.com
Javascript,PHP:-
• https://www.geeksforgeeks.com
• https://www.tutorrialspoint.com
• https://www.javatpoint.com
• https://templatemo.com/
• https://freefrontend.com/bootstrap-login-foms/
• https://www.geeksforgeeks.org
YourThoughts 111