Site admin approval of comments posted by visitors script
You can read the main tutorial on posting comment here. We will discuss how the admin are works in posting comment script. The main purpose of admin area is to approve or delete the postings of the visitors. By default once the comments are posted the status of the posting remains at ns ( not seen ). Records with status equal to ns are not displayed in public area. Inside the admin area site admin after login can view the all the comments or only list the comments which are in ns status ( not seen ). While viewing the list site admin can see name, email date of post etc along with status of the posting. Admin can click the link Details and see full details of the post. Here admin can change the status to apv ( approved ) or can delete the post. Here any approved posting ( status = apv) can be changed to not seen ( status = ns ).
In list.php page all the records ( or posts ) get listed in the order of date of post. If required admin can go to a page where not approved ( status =ns) records are only displayed. Here is the code for list.php page, a simple collection of records from the table.
Admin can view the full details with status change option by clicking the detail link available with each posting. On clicking that admin can visit the page list-dtl.php page where posting details with option to change the status will be displayed. Here is the code.
Once the admin submit the form for change of status the form data goes to list-dtlck.php page. Here all the form data collected and first checked if delete options is selected. Record is deleted if delete option is given or the status is changed as per the selection. After the changes the page automatically redirect to list.php page with a message displayed at the top of the list.php page. Here is the code.
@$todo=$_POST[''todo''];
if($todo=="status-up"){
$f_name=$_POST[''f_name''];
$post_id=$_POST[''post_id''];
$status=$_POST[''status''];
if($status=="del"){
$q=mysql_query("delete from cmt_post where post_id=$post_id");
if(mysql_affected_rows() <> 1){
header ("Location: $f_name?msg=<br>Not able to delete Record ");
}else{header ("Location: $f_name?msg=<br>Record deleted "); }
}else{
$q=mysql_query("update cmt_post set status=''$status'' where post_id=$post_id ");
echo mysql_error();
if(mysql_affected_rows() <> 1){
header ("Location: $f_name?msg=<br>Not able to update Record ");
}else{header ("Location: $f_name?msg=<br>Record updated "); }
}// end of if else
}// end of todo checking
else{
header ("Location: $f_name?msg=<br>Data Problem");
}
I need a instruction on how to install commenting script and how to embed into every page. thanks alot
Manoj
11-06-2009
Hi friends, Nice to read this blog. From the blog i got many informative points.
Ecommerce
12-08-2009
Great Post. thanks, these are really useful informations.
Vill Garcia
25-08-2009
hea, this tutorial helps me a lot. thanks please post more tutorial
Ecommerce web design
01-09-2009
Having written articles that require this much work, I commend you for your service to the future bloggers. I am sure they will appreciate it! Great job. Some great information to be absorbed in this post. Thanks!
Ecommerce77
09-09-2009
Excellent post. These tips are really useful for me. It really helped me a lot. Keep blogging.
Imergent11
10-09-2009
Hello.... This is a great tutorial for me as it is about commenting script. It helps me a lot. I need a instruction on how to install commenting script. Plz help me out. Keep blogging.
dedicated hosting
01-10-2009
A bunch of informative knowledge.A very useful topic for newbies.Great post...
ecofitnessgym
04-04-2010
this script is really good
Dev Chuahan
29-11-2012
This post is complicated
10-07-2022
Comment box Script in php with Reply and approve by admin
✖
We use cookies to improve your browsing experience. . Learn more