Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Reviews Plug In- Sort of...

(Page 1 of 2)
> >
Quote Reply
Reviews Plug In- Sort of...
Hi Ya'll!

Well, I have been working on it for a couple of days now, and I think it works. It is NOT pretty, but it works. On my site. That is to say I wrote it on and for my site, and there may be a couple of things in there that point to a real and not relative URL.... or other things that are specific to my site- oh well.

Anyway, here is what it does.

Works off of the Users table
Keys to the Links "ID" field
Allows only validated, registered Users to Post
Allows viewing, posting, deleting and editing of Reviews by the Registered User/Poster
Allows E-mail to posters (NOT Private!)
Shows User Profiles
Does NOT allow a user to post more than one Review to a Link
Stores Review info in it's own table
Will kick out invalid ID numbers
It does NOT interface at all with Ratings- no pretty pictures and graphs and all that.

(of course, you can change any of that, but not through the slick admin screen.... nope- ya gotta edit the review.cgi)
It is a basic, bare bones Review system.
It is probably still very buggy, and may not work for you... YMMV.

You can see it from:

http://www.bcdb.com/....cgi?film=16&d=1

(I have posted one, short review there for test purrposes there...)

PLEASE do not post unless you delete it, or really mean to post... this is online!

Anyway, here is the problem- I did this all as a series of mod's, and I have no clue how to take and make a plug-in out of it. This mod entails:

1) Making a new Table
2) Adding fields to existing tables
3) Adding a new .cgi script
4) additions to build.pm and site_html.pm
5) adding a couple global language variables
6) about 6 new templates.

And, as I have said, it is probably still buggy, and at the least, could use some polish from it's current state. I am not a great perl programmer at all!

Anyway, is there anyone who would like to try to make it a plug-in? Or for Pugdog's project, if you would like it, let me know. I will forward it on to any serious inquiries... I think it is pretty straight forward writing wise.

Thanks!

dave



Quote Reply
Re: Reviews Plug In- Sort of... In reply to
If you want to donate it, I'll try to turn it into a plug-in as the basis for the project I proposed last week.

Send me a tarball of the code, and I'll see what I can do.




PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
Pugdog!

I was HOPING you would say that! I am adding another function now...

Got to thinking, and it is probably not proper to post everyone's e-mail address, so I added a switch for show e-mail or not. Then, I got to thinking I should let a User EDIT their profile... so I am doing that now.

Don't know how to maker a Tarball, ZIP ok?

dave

Quote Reply
Re: Reviews Plug In- Sort of... In reply to
Zip is fine :)

I'll put it into a tarball for the plug in. It will take some time to analyze what you are doing, and break it up, so once I do, you'll probably have to update the routines to match your current version.



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
Pugdog:

On it's way now....

I added a README for you, but it is all so simple, you should have no problems at all!

good luck!

Dave

Quote Reply
Re: Reviews Plug In- Sort of... In reply to
pugdog:

Just hit me- one of the things I wanted to fix and had not yet in the zip I sent you- it displays the post date yyyy-mm-dd. May want to change that to it updates to the normal date format....

just a thought

dave

Quote Reply
Re: Reviews Plug In- Sort of... In reply to
GT also had a rudimentary simple review plugin that was/is not considered complete. I think the plugin author was Virginia. Anyway, I posted it was installed with my new installation and Alex followed up that it was, but was not considered "done". Might be worth taking a look at that work.

Quote Reply
Re: Reviews Plug In- Sort of... In reply to
The GT review program is pretty basic, it doesn't come close to all the expectations posted in:

http://gossamer-threads.com/...w=collapsed&sb=5

I think tonight, to clear my head, I'll look at the review plug-in from GT and the one mentioned here, and see how they fit together. I'll try to release one combined line of code to get people started on.

But, remember, in a group project there can be no "hacks". Any "custom" solution has to be generalized so it can work for everyone.

One big thing will be to come up with a database format. Some ideas were posed in the other thread mentioned above.

While I'm only cautious about adding new fields to the link record (to keep it as small as reasonable), I'm less likely to want to fiddle with the Users table, due to the large number of potential plug-ins that will try to make use of it. Much better is a "Users_Extra" table, that is keyed to the Username, and holds all the "extra" information this program, and any other, would want to store about the user.

I think that is much safer in the long run. If the Username/Username fields are linked, the tables should be automatically updated if a record is deleted from the Users table.

Some information needs to be stored in the User record, other information in the Links record, and others in the Review table.

What information do people want in the Users/Users_Extra tables? And why?

The Link record really only needs a "Reviews" field that contains the number of reviews, for performance reasons. In doing the category builds, and "link.html" template parsing, there is no need to look up all the review data. HOPEFULLY!! - there is a hook to repair_tables that will allow us to add in the "update reviews" as well as new/etc flags. (I also want to use that sort of hook for attachments).

If the reviews system keeps "summary" data, such as score, ranking, last rated, number of each type of review, etc, this should be in a separate table, indexed by the LinkID, and _NO_ field needs to be added to the Link record. A look up is done on this table whenever a call to display link data is made (link.html, detailed.html, etc). The "repair" function would run against _this_ table, and take the reviews from the reviews table(s), and tabulate them in this table.

The Reviews Table(s) is where we need to put the most thought. What information does this need to hold? What is the MINIMUM information a review record needs to have?

ID(unique), LinkID, Username, Comment, Date.

What else?

Numerical rating?

What about sites that don't want to leave comments, just numerical ratings. Should this be an option during set up? If so, what other options? Range of numerical value? Length of comment? Short_Comment + Long_Comment. Should a "Long_Comment" be a "value added" feture so that only a certain type of user can leave them? What criteria should this be based on?

(as you can see it gets complicated very, very quickly!!)

In thinking about this, the Users_Extra table should hold user demographic information, or stats, but since the Review is a plug-in, maybe the User_Review_Stats should be in it's own table, like the Review_Stats data? That way, during a repair, the User_Review_Stats table is updated with the same information as in the Review_Stats data, but keyed to Username, not LinkID.

Have I bored everyone? s everyone asleep?






PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
I think what you said last is one of the things we need to think about first, how numberical ratings are going to work (in conjunction with rate.cgi)

What options do we have?

- keep rate.cgi and review.cgi completly seperate. Use rate.cgi for ratings and review.cgi for "comments". So perhaps called it comments.cgi instead
- Ditch rate.cgi and get review.cgi to do the lot, ratings and comments.

In a way i think option 1 is better. Mainly because there are times when i would want to only have ratings and not reviews. An example is off site ratings (cgi-resources.com style) also because i will require reviews from a registered user but will let anyone rate a site.

However these features could all be built into review.cgi but it might make it harder.

Now it gets complicated if you want to accept more than 1 ratings, so you have ratings for "design, navigation" etc. Perhaps this is something we should not do yet as it will complicate things quite a lot.

Unless, we are going to have an "admin review system control panel" which would be nice. This would allow you to add the fields, field type and if it is required or not. Then people can add whatever rating field they want.

Finally.. on this topic, what are we going to do about stats? This is one of the cool things about jerry's review.cgi but it only worked with ratings inside review.cgi.

I am not 100% sure what the best path is here...

i think the rest of it you have quite sorted pugdog although i don't think the issue between user and user_2 is really that important, if we prefix all the new columns with something unique i don't see a potential for conflict or a problem really. Keeping two seperate tables in sync might be more effort than is needed.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
padders:

What you wrote is pretty much what I was thinking when I wrote this Review thing. We must remember people use this for many different things, and I think keeping the two (rating and reviews) seperate may be a pretty good thing. I can see where someone may want one and not the other... You mentioned "ratings for "design, navigation""- that is something that would not even come into play on my database!

Anyway, my 2 cents is ratings is ratings, reviews be reviews... and plugins let you have one or both!

I have added the fields right to my Users DB, and I think it enhances it, as you can use that outside of reviews IF YOU WANT TO. I think having the date someone signed on, their location, home page, and whether or not they want their e-mail address posted is not too out of place in Users, and doesn't muck it up all that much. But Pugdog also may have good reasons for a second, linked DB. To be honest, that was just way more than I know how to program- using Users was just easiest for me to write! I just finished a User Edit Profile addon that works great with these fields, outside of Reviews- it even lets you change passwords. (http://www.bcdb.com/...ername=admin&d=1)

Anyway, I wrote what I wanted to, and it works for me. I am sure that Pugdog will fix it and the other scripts into something very nice, and something that works far better than what I have done!

dave

Quote Reply
Re: Reviews Plug In- Sort of... In reply to
carfac that makes perfect sense. For me multi ratings is also useless but i would imagine some people might want it, it is the only major problem i can see seperating rate and review, but then if people want seperate ratings then they can have rate.cgi

What i do wonder though, is it is possible to rate and review at the same time. There are lots of times when we would want to let our visitors rate a link and others review a link but there might be some when doing both from the same form has its advantages. This being possible would be a big advantage. I am sure it would be possible, i started a script about using one script to submit a form to another script using Perl and this could be included here.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
padders:

I do not think it would be too hard, as seperate programs or integrated in one.... just put the "Rate" code on the "Review" page, and require it in processing... well,, there is bit more, but should not be hard to do...

dave

Quote Reply
Re: Reviews Plug In- Sort of... In reply to
I agree that having ratings and reviews on the same form will come in handy. I, for instance, have been using both in one form. This is a slightly customized version of review.cgi from widgetz.
http://www.scutwork.com/...s/review.cgi?ID=2457

waffle
Scutwork.com
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
I agree that having ratings and reviews on the same form will come in handy. I, for instance, have been using both in one form. This is a slightly customized version of review.cgi from widgetz.
[url=http://www.scutwork.com/cgi-bin/links/review.cgi?ID=2457]Click here to see example[/url]

<b>waffle</b>

<a href="http://www.scutwork.com">Scutwork.com</a>
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
I wonder what hotscripts are using. They are still on links SQL v1.x arn't they?

http://www.hotscripts.com/Detailed/8307.html

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
Yes...it is not difficult at all, of course, what you have to do is add a sub that adds and substracts Ratings value in the Links table. Widgetz did not include this in his MOD...I was able to simply write a sub in the review.cgi and associated review scripts (I modularized review.cgi into delreview.cgi and modreview.cgi) that will update the Build_Update update according to the addition of a ratings and votes or deletion of a rating and votes.

I also made the Ratings column in the User_Reviews table NULL and non-required in the User_Reviews.def file, so that users could either simply submit comments about links or also add a rating.

Regards,

Eliot Lee
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
padders,

Yes...hotscripts is using Links SQL 1.X. However, the review system is a highly modified version of Michael Bray's PHP Review script that was written for Links SQL 1.X.

Regards,

Eliot Lee
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
I've been following the Interchange (formerly minivend) mailing list for quite some time, and long-time readers here will remember my comments on minivend and why a new shopping cart was needed -- and why basing on the Links engine/framework was good.

Here is a review of why someone quit using InterChange -- I think some of the arguments, and design issues will strike a chord or ring a bell here. Maybe help understand why Links 2.0 took so long, and why it's just not simple to rush in create code for long-term use -- it requires planning, and inevitable redesign, and why it's so important to develop a "normalized" database structure and logic flow.

http://mark.stosberg.com/...erchange/review.html


PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
ar... PHP there is a language I can understand! It would be nice to tie it into links but this is where i might a review system is not forthcoming.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
May be Michael Bray will write a "plug-in" to tie into Links SQL v.2.X. Don't know for sure...don't really think you will need to do much with his Links SQL v.1.X Mod other than changing references to the appropriate tables that have changed in Links SQL v.2.X.

Since you are more experienced with PHP, you may be able to write a script yourself....

Regards,

Eliot Lee
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
i'll email him and ask. Havn't seen him here for ages... is he still around?

ASciFi.com http://www.ASciFi.com/
Help Desk http://www.Techuk.com/HelpDesk/
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
I don't believe he has upgraded and looks from his site that he is using mostly PHP for front-end scripts and using Links SQL v.1.X for back-end scripts. I know that he was here about five months ago when the slew of Links SQL NG Betas were released and posed questions of integrating PHP plug-ins with Links SQL v.2.X, but other than that, he has only been in and out of the forums a few times.

Regards,

Eliot Lee
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
I'm still around :) I just don't post much anymore cause I rewrote Links SQL in PHP - don't even use it for backend code now (I use a lot of logic from Links SQL, and it really helped me understand how to design scripts better however).

The review script I wrote was the first thing I ever made with PHP, and was extremly basic. Basically add it did was tie in the Link_ID with a review - which was very simple at the time. I made it have its own UserDB which again was very simple.

I have written some pretty nifty PHP functions now for handling SQL queries, and have learnt alot since I wrote that script. If I have time, I'll make a better version of the review script and donate it to you guys to turn into a plugin.

I've been around here for the last 5 months, I only read the Links SQL forums, and then top section ones, annoucements... discussions.. customer mods. Just been too busy to post :)

Discuss webhosting at
The Webhost Area Forums!
http://www.webhostarea.com/forums/
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
any chance of getting a look at the php functions ? ;)

ASciFi.com http://www.ASciFi.com/
Help Desk http://www.Techuk.com/HelpDesk/
Quote Reply
Re: Reviews Plug In- Sort of... In reply to
I donno :) I am gonna use them in a script I am going to sell... I'll think about it :P

Discuss webhosting at
The Webhost Area Forums!
http://www.webhostarea.com/forums/
> >