semiColon Posted November 29, 2007 Share Posted November 29, 2007 hello everybody!i used this guest book: http://www.phpjunkyard.com/php-guestbook-script.phpit's so far so good with me.. but how can i prevent the posts by the guests until i approve them?Thanks, Link to comment Share on other sites More sharing options...
Ingolme Posted November 29, 2007 Share Posted November 29, 2007 If you were programming it yourself, I'd say add an extra field to the database table for "approved/not approved" and make it "not approved" for guests by default. Then you can switch it to "approved" in some kind of admin panel. Link to comment Share on other sites More sharing options...
semiColon Posted November 29, 2007 Author Share Posted November 29, 2007 No.. this guest book have not a database..Is there another way to do that? Link to comment Share on other sites More sharing options...
Ingolme Posted November 29, 2007 Share Posted November 29, 2007 A guestbook without a database? Then it must save the data in a text file or something?If you had it in a database it would be so much easier, something likeSELECT * FROM table WHERE approval='approved'I don't know hwo this system you want works, so I can't help you. Link to comment Share on other sites More sharing options...
semiColon Posted November 29, 2007 Author Share Posted November 29, 2007 yeah, it uses a text file to save the data.i'll try another with a database, if there isn't any method to that without it.. thanks, Link to comment Share on other sites More sharing options...
Ingolme Posted November 29, 2007 Share Posted November 29, 2007 Anything can be done if you put some thinking into it, but I just find it simpler with databses than text files. One could build a PHP library that reads and writes in text files with an SQL-like syntax, but I believe it to be more work than it's worth. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 29, 2007 Share Posted November 29, 2007 That list of bad words is a good read. Thankfully GBook is protecting the internet against people posting words like "asinine", "christ sakes", "jerk", and "n3gro". Sounds a little asinine to me.Line 726 of the main script is this:$addline = $name.$delimiter.$from.$delimiter.$email.$delimiter.$url.$delimiter.$comments.$delimiter.$added.$delimiter.$isprivate.$delimiter.'0'.$delimiter.$_SERVER['REMOTE_ADDR']."\n";That is the line that it's going to write to the file. You can add your own field there to indicate whether or not the entry has been approved. Line 878 has this:list($name,$from,$email,$url,$comment,$added,$isprivate,$reply)=explode($delimiter,$lines[$i]);That is breaking up the line in the file into variables to print. You would modify that section as well to get the approval field and check if it's approved before it gets displayed.I'm not sure how the script checks if someone is logged in or not. I'm not sure about that script in general, I don't really have a lot of faith in people who use things like <p> </p> Link to comment Share on other sites More sharing options...
killboy Posted November 30, 2007 Share Posted November 30, 2007 Why don't you program the guestbook yourself? It's quite easy... I could give you some code if you will Link to comment Share on other sites More sharing options...
morrisjohnny Posted December 5, 2007 Share Posted December 5, 2007 If you want a guestbook, i could provide you with one although it does use a database, but with a little tweaking i could add the approved not approved feature on it, along with "block word's" list.? just message me on the forums if your interested as i'm currently at school and wn't b home for another 12 hours. Link to comment Share on other sites More sharing options...
semiColon Posted December 5, 2007 Author Share Posted December 5, 2007 Thanks all my friends..I've done it ..(f) Link to comment Share on other sites More sharing options...
morrisjohnny Posted December 5, 2007 Share Posted December 5, 2007 no bother, glad to see you have done what you where looking for Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.