Gossamer Forum
Home : Products : Links 2.0 : Customization :

Delete Reviews - Review.cgi

Quote Reply
Delete Reviews - Review.cgi
I was wondering if anyone has successfully hacked widgetz's review.cgi to delete associated reviews when links are deleted. I have read through about 300 Threads and Replies relating to widgetz's awesome Mod (which I successfully installed in about 20 minutes...took me about 5 hours to customize and test add-ons)...and I saw nothing related to this issue.

So, before plugging away at this code hack...I was wondering if anyone has successfully done it before or if anyone has suggestions on how I should do this. I have some ideas...but open to hear other suggestions.

Thanks in advance.

Regards,

Eliot Lee
Quote Reply
Re: Delete Reviews - Review.cgi In reply to
Well...I'll help bring this back up to the top, because I would be interested in this also.......

Plus, while on the subject of the review mod, Eliot it looks like you just installed widgetz review mod, so maybe you might be able to answer these questions. I just manually installed the mod, and was wondering before I run the reset.cgi script...what exactly it does? Will it just reset the rates and votes or will it reset the hits also? Plus, I know widgetz mentioned on his page that you should test everything before running the reset.cgi file....should I test adding ratings and reviews or do I need to run that file before hand? Also, have you noticed that a user can submit a rating without entering their name and email? I'm not sure if it was purposely done like this or not. Anyway, I think that's all. If you have any other pointers with this mod, I'd like to hear them. Thank you.

Quote Reply
Re: Delete Reviews - Review.cgi In reply to
Thanks for bringing this back to the top...I have the skeleton of the codes that I am going to use laid out. Just have to add in some deletion codes....Yet I do not think I release it unless others are willing to assist with the Mod.

Smile

In Reply To:
I just manually installed the mod, and was wondering before I run the reset.cgi script...what exactly it does?
It will reset both ratings and votes....

Look at the following line of codes in the reset.cgi script:

Code:

$values[$db_rating] = $values[$db_votes] = 0;


In Reply To:
Will it just reset the rates and votes or will it reset the hits also?
Nope...why would reseting the hits affect the new rating system, which is based on Votes (ID in the review.db) and Ratings?

Wink

In Reply To:
Plus, I know widgetz mentioned on his page that you should test everything before running the reset.cgi file....should I test adding ratings and reviews or do I need to run that file before hand?
You should first test adding reviews and see if everything works...then you should execute the reset.cgi script. Pretty self-explanatory.

Wink

In Reply To:
Also, have you noticed that a user can submit a rating without entering their name and email?
Yes...But I deleted the following codes:

Code:

if ($in{$db_cols[$db_review]}) {
($in{$db_cols[$db_contact_name]}) or &site_html_review_failure ("$db_cols[$db_contact_name] (Can not be left blank with Review)") and return;
($in{$db_cols[$db_contact_email]}) or &site_html_review_failure ("$db_cols[$db_contact_email] (Can not be left blank with Review)") and return;
}


You will notice that these codes state the following:

Code:

If someone submits a REVIEW, then they have to submit a NAME and EMAIL ADDRESS.


In Reply To:
I'm not sure if it was purposely done like this or not.
Yes....it is on purpose. The Review.cgi Mod allows you to submit EITHER a rating OR review OR BOTH.

In Reply To:
If you have any other pointers with this mod, I'd like to hear them.
What other pointers do you want???

Smile

BTW: I am using Widgetz's mod for REVIEWS only, however, I have the rating form in the review_success.html file to encourage people to submit a Rating. Yet, I am also in the process of adding in the Rating field that will create the ID file in the $db_rates_path as to not screw up the current Ratings and also the External Rate It Mod.

Regards,



Eliot Lee
Quote Reply
Re: Delete Reviews - Review.cgi In reply to
I have only installed the review system (no reviews yet) and if I remember I asked widgetz when the mod was written, and may have also checked myself. I thought it automatically deletes the whole record in the review database when a link is deleted from the main database.

Quote Reply
Re: Delete Reviews - Review.cgi In reply to
In Reply To:
I thought it automatically deletes the whole record in the review database when a link is deleted from the main database.
Where are these codes????

I have looked through all the codes and could not find any subs that does this....

Smile

Yep...I just looked through Widgetz's instructions and the README file again...there are NO codes to automatically delete Reviews when Links are deleted!

Wink

There are only two subs that go in the nph-build.cgi file:

1) sub sub build_auto_review
2) sub build_update_ratings

Neither of these subs deletes Reviews.

And there is only one sub that goes in the db_utils.pl file:

1) sub build_sorthit

And the two subs in the site_html_templates.pl for getting ratings and graph also do not delete Reviews.

But, I appreciate your response. If you happen to know a code hack add-on that does this, I would greatly appreciate a link to it since as I mentioned before I have read over 300 Threads about this Mod.

Smile

Regards,

Eliot Lee
Quote Reply
Re: Delete Reviews - Review.cgi In reply to
Hi Eliot,

Well, I have not looked through the whole codes to see what they are supposed to do. Basically, I installed the Widgetz's mod in its entirety - downloaded from his old site. Why don't you create a fake link in your db and write a review and delete to see if works. If not then I know you can delete a review from the admin and may be I am confusing it. But I know I had asked him a question regarding this but I have no reviews and don't know for sure.

Quote Reply
Re: Delete Reviews - Review.cgi In reply to
In Reply To:
Why don't you create a fake link in your db and write a review to see if works.
UH...I have already DONE THAT!

In Reply To:
If not then I know you can delete a review from the admin and may be I am confusing it.
Yes...I know that...you can delete it from the admin.cgi. What I am looking to do is automatically deleting the Review if the Link is deleted.

In Reply To:
But I know I had asked him a question regarding this but I have no reviews and don't know for sure.
And where is the answer??? If you can find the Thread that covers this issue, let me know...As I stated before, I have already over 300 Threads/Replies that addresses problems with Review.cgi.

Thanks for your input. I do appreciate it.

Regards,


Eliot Lee
Quote Reply
Re: Delete Reviews - Review.cgi In reply to
Edited by Eliot Lee....

Look further down or in other Replies for updated information.

Regards,
Quote Reply
Re: Delete Reviews - Review.cgi In reply to
Ok...thanks, I actually didn't attempt to do anything before I asked the questions, I was just looking for some pointers on how it works.....but I'm foolin around with it and it's all lookin pretty good, thanks.

Quote Reply
Re: Delete Reviews - Review.cgi In reply to
You're welcome....

IMHO...Best thing to do with any script is test it out yourself...play with it...then when you have problems or questions, search the forums (technical support) and resource center (technical documentation), and then post a question or comment in the technical support forum.

Regards,

Eliot Lee
Quote Reply
Re: Delete Reviews - Review.cgi In reply to
Eliot,

Thanks very much. I would need this down the road. I am not using multiple databases (for the same links, like you were doing) but I am using multiple copies of links.

Also, have you looked at the codes widgetz uses in the admin.cgi to delete the reviews? May be you can use some of those codes with this cgi to delete individual records.
Quote Reply
Re: Delete Reviews - Review.cgi In reply to
In Reply To:
Also, have you looked at the codes widgetz uses in the admin.cgi to delete the reviews?
Uh...that uses the sub delete_records routine in the db.pl....(not new codes for the Review.cgi Mod).

Nice suggestion though...I have already looked at those codes...I will look at them again.

Thanks.

Regards,

Eliot Lee
Quote Reply
Re: Delete Reviews - Review.cgi In reply to
Yeah...I hear ya, which for the most part, I usually do, cuz I like to work through most of the problems "myself first". I've just been waiting for such a long time to get widgetz review going. Actually, after looking at that install file several times, I just realized that I could have found the necessary files myself...but for some reason I overlooked it! Considering it was a manual install, it all went well. :-) How's the progress on this delete mod? Any luck with it?

BTW- Do you know the names of the rating images offhand? I know that a 0 rating is rate0.gif, so I'm going to assume a rating of 1 would be rate1.gif, a rating of 2 would be rate2.gif ect.....but what about for ratings like 8.33 or something similar? I couldn't really find any references in the files....and that long post REVIEW.CGI only has the first page, all the others are missing?? Thanks.

Quote Reply
Re: Delete Reviews - Review.cgi In reply to
All you have to do is upload 20 rating images (rate0.gif => rate20.gif) in the ratings image directory that you defined in the links.cfg file.

Regards,

Eliot Lee
Quote Reply
Re: Delete Reviews - Review.cgi In reply to
Okay...I am getting closer to a solution...I've decided to edit the sub delete_records routine in the db.pl file to delete associated Reviews when Links are deleted.

When I come up with a solution that is easy for people to understand...I will post the codes...but I don't gaurantee that I will come up with a "universal" solution that can be easily implemented by others...

Regards,

Eliot Lee