About Parmacitynews.com
PCN is all about the local news by the people that live there. Not that the newspapers or news programming on tv isn't great, but they risk being one-sided/biased. The population of Parma is far greater than the reporters; the citizens could easily cover more material that may slip past the media. I'd like this site to promote the news that never really makes the news; turn on a tv, its all about crime: murders, robberies, terrorism, etc., this site could cover the positive news, too.
A few notes
I wrote the majority of these codes; only a few were found online.
I don't know javascript very well, so the login form on the banner (text disappears on click) was found online.
The code that generates a random password/activiation code was from online.
Also, the image resize code was not by me.
The rest, however, were typed by me. I learned a lot, actually.
- I was going to find a "pagination" code online (Displays the <<First 1 2 3 4 Last>> buttons on browse, etc) and use it, but after looking at several examples, I managed to write my own basic code.
- Certain things are only viewable by staff members, such as the submissions and delete article pages. Also, only the owners/staff members can edit/delete articles and comments, etc.
- The front page displays the last article written and the featured article, if the featured article is the last one written, the last article moves up to the one before.
- Articles have to be verified by a staff member before they are listed or viewable by users (filters spam/irrelevant ramblings, fix formatting)
- Some pages need you to be a registered member/logged in to view. If you are not logged in, it will direct you to the login screen, and once submitted, you will be redirected to whatever you were previously trying to view.
I'd like to actually launch this website in 'real' life, for more than just a scholarship. I think Parma citizens would enjoy it.
Functionality of PCN Files:
Well, a brief overview.
activate.php
- Checks for id & code
- Checks if account is already activated
- Checks if query runs right
- Activates account
article.php
- Displays article
- Author info
- Delete/Edit article [If user is owner or staff]
- Approve Article [If user is staff]
- Displays comments
- Add comment form
- Displays verification needed [If article is pending]
- Make featured article button [If staff]
browse.php
- Browses articles submitted and approved
- Makes link to author's details page and a link to browse by a certain tag
- Sort By Submitted Date
- Sort By Tags
- Sort By User
browseusers.php
- Displays verified users
- Links to profile page
controlpanel.php
- Change Email [Can't change to another users email]
- Change Password [Has to match]
- Change name
- Change avatar
- Change bio
delart.php
- Checks user class
- Deletes article
delcom.php
- Deletes comment
- Checks if user is staff or comment owner
- Returns user to previous page
edit.php
- Determines it is an article, article comment, or user message
- Updates field in database
featuredar.php
- Displays currently featured article
- Field to type in article id to set as featured article
index.php
- Displays featured article
- Displays latest article
- Limits characters of displayed articles and provides a link to see entire article
login.php
- Checks that fields are not blank
- Checks username exists
- Checks password corresponds to username [Correct password]
- Checks for redirect
- Sets cookies
logout.php
- Deletes cookies
new.php
- Makes new article
- Validates input
- Highlights errors in red & displays corrective text
- Submits article to be approved
pstyle.css
- Holds style information
recover.php
- Checks that user is not logged in
- Checks email is in database
- Generates new password
- Sets new password in database
- Emails new login information
search.php
- Searches in body, tag, or title fields
signup.php
- Displays signup form
- Validates input
- Generates secret code
- Emails verification link
- Inserts pending user into database
top.php
- Holds functions
- Connects to database
- Keeps user logged in
- Header info
- Displays side menu
userdetails.php
- Displays users info
- Displays link to articles by user
- Displays user messages
- Displays user message box
verify.php
- Lists pending articles
- Approves/Deletes individual articles