Archive: Fixes for javascript (ajax), php, mysql

Budget By arrangement
Posted: 5 years ago
Closed
Description
Hello!

I have a threaded comment script that needs the following fixes in Javascript (including ajax), php, html, css, and mysql.

Website:
https://www.kingjamesbible.me/bible-forum/


You can register and login to view the comment script and reply, like, report. Functionality works at some level, but needs fixes and the goal of this project is to finish it's development so it's ready to go live. Here are the fixes to make:

1. Continuous scroll pagination. Want like Reddit where user scrolls down approximately 100 comments and more comments in that thread will either autoload or user will click 'View more comments' and more will appear below- appended to the end like Reddit or Facebook does. When further comments are loaded it shall be accurate, so we don't want reply comments to be missing if mysql limits to We also must be efficient and only do 1 mysql query at a time, not multiple or recursive queries. This is very important. Currently only 1 query generates all the threaded comments. I believe the comment reply matches are made by modifying the array order. However, when query is limited to the first 100 comments and replies, it's important that it shows all in their proper order, and when continuous load occurs its important that it presents the comments and their replies accurately in their proper sequential order also. For example, it the query is limited to 100 and if the 101st comment is a reply to the 1st comment. The first 100 comments should include the 101st comment because it's in the proper order as user would expect, sorted by date DESC (most recent first), with 1st root comment, then all of its proper replies of all levels, then when no more replies, the 2nd root comment, etc. Maybe many of the replies to the first comment is in row 20000 of the database, so if only the first 100 are queried, that would not work properly. I hope this is making sense. So, it's possible the logic and structure of the comments may need to be modified for the contiuous load pagination, as the developer who made this was supposed to make a 'closure table' style of comments, but did a shortcut and this is the result. We have more than 100,000 comments in different categories, so one thread may have tens of thousands of comments which can't all load on a page at once, because it's too slow, need to be done in only small pieces of 100 comments at a time. I believe a closure table design would have made all of this easy, but again, that's not what the developer did. So, I kindly ask for it to be fixed.

2.The login button (uses ajax to overlay modal on page) only works once then doesn't work again. It needs to open more than once.

3. The login/register modal is a different size when loaded via ajax overlay than when loaded standalone, likely because there is body css that is affecting it. It should be same size either way and should overlay in either case.

4. I want visitors (logged out and unregistered) to view comments page, but just not allow them to comment, reply, like, report, otherwise show popup modal signin/register.

5. Password should be encryped using php 7.2 password_hash and stored that way into mysql. (Currently it uses mp5 or something weak).

6. Need email link verification after registering, should be sent from server using dkim and https in a way that won't be reported as spam, and has high deliver-ability rate.So, right after user registers, it won't let them signin to reply/comment/etc yet until they first click an encrypted link hash (short only 6 chars or less for hash part) to verify email. Then after they do, they can sign in and use all features normally.

7. On Login/Register modal, it says 'Already have an account?' - I want this to link to the Sign In tab. For 'Need an account?' I want to link to the Register tab. Currently it is not linked to anything.

8. Want clicking the | separator to result in minimizing/collapsing a section of reply comments, for easier reading. Like Reddit does. The separator is created from line 94 of style.css which forum.php uses in divs with class 'replies'. It's possible tweaking the code will be necessary to make the bar clickable and toggle class to 'display:hidden'. When hovering separator I want arrow to turn into hand (cursor: pointer;) and want hover to make line it darker.

9. Reporting currently successfully inserts into mysql the report tally and temporarily disables the link (until page refresh), but needs the following improvements.
a. I want improved so it uses the 'modal.html' popup option that is shown at https://www.kingjamesbible.me/bible-forum/report.html - this shall only be loaded via ajax upon the user clicking the report button. The html/css shall not be loaded before the user clicks. (This is so the page load is fast for most users who do not report things). This shall occur 2 stages: 1. User clicks report on a specific comment, step 2: User chooses one of the 5 option buttons. Then the button chosen (1-5) shall by inserted into 'members-reports' table. Then, total reports in the 'msg' table should be updated (this part currently works).

a. When a comment is removed but replies exist, replies should still show on the screen under the comment [Comment Removed]. It shall not actually delete the comment in the table, but have php logic for whether comment is enabled or disabled, if comment = disabled then echo "Comment disabled", for example.

b. If a commenter's comment is removed (2 or more reports by 2 unique users logged in) then that user shall have their 'reports' number in 'users' table will increase by 1. If two or more users report the same comment, the 'approved' field shall automatically change from 1 (approved) to 5 (disapproved) and will automatically be removed from the comments. Also, if commenter (member) himself has 2 or more reports in their users table then his future comments will not automatically appear in site- comment 'approved' status in mysql will be at 0 (unapproved). But all commenters with no reports will have comments automatically approved with 'approved' status marked as 1. Script which shows comments and replies should only show comments marked as '1' approved status.

c. The report comment modal shall have the following numbers updated in the mysql `msg` 'approved' field: offensive = 4, spam = 5, incorrect = 12, off-topic = 2, other reason = 13.

d. After ajax file is loaded first time, instead of reloading file after every report, it should just stay in memory to be faster and more efficient (until user reloads page). File should not be preloaded before user clicks report the first time, however.

10. Liking should work similar to #9. If user is logged out and tries to like the signin modal appears via ajax (form should not be preloaded, only after clicking). Liking should add to the members-likes table. So, liking shall load php file via ajax with the logic and then it first checks to see if user has already liked that comment, if so then it says 'Already liked' via ajax or if not, then 'You liked this...' in small text via ajax- perhaps replacing the like link. And liking should be disabled for that element, which will save stress on the database if user wants to click 100 times in a row. Also, after ajax loads for liking comment, we should not reload the same ajax file for more likes, reports, etc. and should stay in memory (until user reloads page).

11. Prevent user from replying, liking, or reporting their own comment. It shouldn't show the small text options underneath if it is their own comment. Script needs to be added to check if it is their comment then not show those options. Currently it will only show 'reply' link option after replying via ajax. But it should not show that. Then when user refreshes it will show all options, however it still should not show those options if it is your comment and if you are logged in and session is active.

12. There is something in the code that is using GET for login or register modal. It is outputting the private variables in the URL like this: https://www.kingjamesbible.me/bible-forum/login/api/user/login.php?username=Frank&password=1234 - Ajax should be switched to POST and be secure in all ways so no passwords and usernames show in the URL.

13. When logging in it only says 'success' and ends. It should already be on the forum page with modal overlayed and when successful modal should auto close and user should already be on the proper forum page. Please note that user logged out can view all comments and close comments, but as soon as any reply, report, like, login, register is clicked, user should get the ajax modal popup to signin/register.

You shall be responsible to fully test your code changes for compatibility in various browsers/devices and ensure no changes break existing functionality. We will not test this on your behalf but should be bug-free when project is complete.

All code changes shall be plain javascript, plain php, plain css, plain html. No jquery and no frameworks of any kind allowed for this project. We will not use jquery, nor sass, nor bootstrap, nor react, nor anything else. All code is custom code originally written. It is done for lightning fast speed on mobile devices and is high traffic website, so we will never use external scripts or frameworks, etc and won't change our mind on this requirement.

The text here was cut off at the bottom. Please read the attached for the full detail. Thank you!
Working conditions:
Fixed Price
Not Sure
W9 Required for U.S.
Skills:
html,javascript,php,mysql,ajax
Category

Similar freelance jobs

safe 
...
7 months ago
safe$7
Hi Robert P. , I noticed your profile and would like to offer you my project. We can discuss any details over chat....
safe 
"Hello, I need to create a website based on a . psd design file. Please also specify the timeframe within which you can complete this. Technical requirements: Layout (not pixel-perfect, but close to it) Responsiveness (the website should properly adapt to different screen sizes and devices) Clean code......
safe 
Project Title: Delphi Code Feature Creation Using delphi: Check to see if this already exsits, if not: create a shedulled task to start my program on PC startup with highest permissions, with no password or prompt. program is called for example: C:\Program Files (x86)\Myfolder\myprogram. exe If it already......
safe 
I want to create a program for customers and sellers to be able to use, to create a template for there artwork and be able to size them to there specific needs. And be able to download them as pdf or png files. This program will benefit the clothing industry with the industry i am in....
safe 
Hi, I am not quite sure if what I am asking is possible but within my University degree there is a calculator program which only works on the HP Prime prime calculator, I own a Casio fx-CG50 AU. I was hoping to have this program converted into a format which is compatible with my Casio calculator, all......
1 year ago
safe 
I am looking for a skilled C++ developer to help with a real-time object detection system for my project....
1 year ago
safe 
Project Title: Correct Rcpp armadillo code Overview: I am seeking a skilled developer to fix a compilation error in my Rcpp armadillo code. The code is currently throwing a compilation error, and I need it to be resolved promptly. Requirements: - Proficient in Rcpp and armadillo library - Strong understanding......
1 year ago
safe 
Project Description: - I am looking for a freelancer who can combine all the columns of 2 rows with similar values in Telerik Reporting. - The combined data needs to be displayed in a table view. - Ideal skills and experience for this job include: - Proficiency in Telerik Reporting. - Strong understanding......
1 year ago
safe$250
Bonjour Dmytro M. , j'ai remarqué votre profil et je souhaite vous proposer mon projet. Nous pouvons discuter des détails via le chat....
safe 
Hello, I am looking to develop a unity soccer game with moves like score hero 1. Map with 1-3 stars achievments 2. engine to make the goals like i want 3. smooth game play 4. IAP , shop , buy lives 5. lives to play 6. finger smoothness touch 7. the level will be added automticlly to the map 8. rewind......
1 year ago
safe 
Project Title: Bootloader For Renesas RL78 mcu Description: I am looking for a skilled developer to create a bootloader for the Renesas RL78 mcu. The ideal candidate should have experience with Renesas RL78 mcu and be familiar with the development environment. bootloader code is ready need help for run......
safe 
I am using EMA´s (50/75/100/200),two Stoch (5/5/5 and 5/3/3), RDX Indicator and the Indicator "The Arty". For Short Positions the Prive has to be under the 200 EMA (the 100EMA under 200, 75 under 100, 50 under 75, NOT crossing) and for Long Positions over the 200 EMA ( 100 over 200, 75 over 100, 50 over......
1 year ago
safe 
My project involves using an Emotional Stroop Task to measure and assess attentional bias towards emotional stimuli. To do this, I will be using the Drift Diffusion Model which is an analytical model to study the human decision making process. My study will need to include 90 participants in order to......
safe 
I am looking for a WPF Developer for a long term project....
1 year ago
safe 
I'd like to extract tables from pdf invoices files. At this stage i really only want the products that are in the tables on the invoices. The only information i would like from the invoices is supplier date (received) location received. Within thetables i require stock code, product item, the unit measurement......
1 year ago
safe 
Im creating a config using 'openbullet 1. 4', everything added successfully, due i have 3 years of using openbullet, but this request i never faced it before!...
1 year ago
safe 
This position is responsible for verifying data quality reports and queries, correcting errors and also tracking them....
1 year ago
safe 
We are currently looking for developer to contact us on developing integration/plugin for below listed platform. Please drop me message on which plugin you're able to develop. Please send similar plugin portfolio of your previous work. The plugin need to ready for uploading to marketplace . ActiveCampaign.......
3 year ago
View all