Gossamer Forum
Home : Products : Links 2.0 : Customization :

Adding Admin Review Mod - Step-by-step

Quote Reply
Adding Admin Review Mod - Step-by-step
Hello,
Not sure if this is written out in any one place, but if it is I couldn't find it. I gathered this from a bunch of sources here on the forum (kevinhost, Bobsie, Alex) so that people who want to do this have all the information all in one place.

This mod allows you to add a field to the links database called Review. With this extra field you can write reviews on sites that you think are worth reviewing Smile

Step 1:
Edit your links.def file. You need to modify 2 lines and add an additional line.

1a) modify this line in your links.def file.
Original: ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']
Modified: ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],

1b) add this line right after the line you just modified:
Review => [14, 'alpha', '40x10', 999, 0, '', '']

1c) now modify this line.
Original: $db_votes = 12; $db_rating = 11; $db_mail = 13;
Modified: $db_votes = 12; $db_rating = 11; $db_mail = 13; $db_review = 14;

Step 2: Modify your links.cfg file to turn on detailed view.
Original: $build_detailed = 0;
Modified: $build_detailed = 1;


Step 3: Run this script in your admin/data directory for links. It updates your database to add a new field (modification of Alex's upgrade_beta.pl script. Thanks Bobsie Smile

Code:
#!/usr/local/bin/perl
# -------------------------------------------
$ENV{'REQUEST_METHOD'} and (print "Content-type: text/plain\n\n");
open (DB, "<links.db") or print "Unable to open links database 'links.db'. Reason: $!" and exit;
open (DBOUT, ">links2.db") or print "Unable to open output database. Make sure hits dir is chmod 777 temporairly. Reason: $!" and exit;
while (<DB> ) {
chomp;
s/NULL//g;
print DBOUT "$_|\n";
}
close DB;
close DBOUT;
print "Added a new field onto the end. Saved it as links2.db.";
# ---------------------------------------------

Step 4: backup your links.db in case of problems.

Code:
cp links.db links.db.old

Step 5: Copy the new db file to the file links uses.

Code:
mv links2.db links.db

Step 6: Now edit your template files so users can read the Reviews:

6a) Add this to link.html after the "Rate It" link (within the <small> tag)
<%if Review%>
[ <a href="<%build_root_url%>/Detailed/<%ID%>.html">Read our Review of this Site</a> ]
<%endif%>

6b) Add this code somewhere in your detailed.html:
<%if Review%>
<h2>Review:</h2>
<%Review%>
<%endif%>

That should do it. Now to add reviews just modify an existing link and type your HTML into the "Review:" box.

Also Check out these forum posts:

www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/000865.html
www.gossamer-threads.com/scripts/forum/resources/Forum11/HTML/000219.html


Post here if you have problems. This works for me. Hopefully there are no typo's in the code examples Smile

[This message has been edited by crisco (edited March 29, 1999).]

[This message has been edited by crisco (edited March 29, 1999).]
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
crisco,

Good work. There is only one change I would recommend:

Code:
<%if Review%>
[ <a href="<%build_root_url%>/Detailed/<%ID%>.html">Read our Review of this Site</a> ]
<%endif%>

I would change this to read:

Code:
<%if Review%>
[ <a href="<%build_root_url%>/Detailed/<%ID%><%build_extension%>">Read our Review of this Site</a> ]
<%endif%>

Then add build_extension => $build_extension to the %globals variable in site_html_templates.pl. That way, if a person decides to change the extension they use, they only have to do it in one place, links.cfg, without worrying about where else .html may appear in their files.
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
ok stupid question time. I got it all working but first how do you ADD the review? 2nd how do you modify that persons database thru the admin screen to let the db know there is a reveiw? I didnt see a field when modifying for review...????
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
How do you set this up so that anyone can write a review on a particular link.
Thanks..
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
Anyone can't add a review, using this modification. You, the admin have to add a review that you collect via a stand alone input form, from your user on some other page.

I do not know coding, otherwise I would put one together. My suggestion is to link an external guestbook or a bbs so anyone can write a review. I am still waiting for Kevinhost, who mentioned a while ago that he was able to link an external database, so anyone can write a reivew. This way the database is standalone (external) and anyone can write a reivew automatically for any link. Unfortunately, he does not have time to put all the instructions together. Hope he will help us, when he has time sometime soon.
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
Hello. I am almost done this review mod but just customizing it and making it easier for you to implement on your site.

So far, all you have to do is customize the headers and footers to go along with the look of your site. I just need to add the option of being emailed if you want to review a review once a visitor adds one. I know there is a huge request for this but I thought it would be better if I made this mod as easy as possible to implement for those of you who do not know PERL. HTML should be known when editing the headers and footers though.

For a preview, look at hostglobal.com and tell me what you think. The pages are cgi generated and may take a little longer to access than static HTML pages.

Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
LINKS v. 2.0 NO TEMPLATE
----------------------
I m confused from step 4 ...

I have coppied the code and saved it as update.cgi

and in step 4...Well I m using a Brand New Script.. No Links at all... What do I do with this?? any modification about this LINKS.DB.OLD?? STEP 5 too..

then I m using NON Template.. what can I do???

Thank you

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
 
Quote:
1a) modify this line in your links.def file.
Original: ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']
Modified: ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']

Is it just me, or are these two lines identical?
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
In response to webdiva:

Click on modify a link in admin screen and select a link to modify.

At the bottom of the modify link page, right after send-email, you should see a text box Called review. Type your review in there.

If there is anything in the textbox the script knows there is a review and prints that info else, if the textox is blank the script ignores it and prints nothing.

If you don't see the "Review:" Field you missed a step someplace.

[This message has been edited by crisco (edited March 29, 1999).]
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
In response to Brad:

No, the second (modified) line should have a comma at then end. That is the only difference.
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
In response to Webking:

Step 4 just back up your current links database (links.db) to a file called links.bd.old.

That way if you really screwed something up editing links.def or for some odd reason the add_field.pl script mauled you database, then you would have a copy of your database to revert to that is from when you started making your changes.

The update.pl script needs to be run on your links.db file. To run it you have to "chmod u+x add_field.pl" then just type add_field.pl. Remember add_field.pl must be in the same directory as your links.db file.

As for non-template use I guess you would have to edit site_html.pl to add the new <% %> tags in the proper places.

Hope that helps a bit, you questions where a little confusing though.
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
How do non template users edit the site_html to add this mod.

Thanks,
Lpluby
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
Sorry, my mistake, I didn't realize that I had uploaded the link.html file to the admin directory instead of the templates directory, causing me unnecessary grief.
Great Adaption of the links detailed view in this mod.

[This message has been edited by Visionary (edited April 18, 1999).]
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
Right now I'm kinda curious after 1 month whether there is an implementation for reviews in Links 2.0

I know now there is a possibility to let the webmaster take care of the reviews, but perhaps right now after 1 month or so users can give their own review? Without using a form or email to sent me their review.

Hope to hear from it soon

------------------
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
The mod outlined in this thread is one method of an "admin review". If you check the Resource Center at http://www.gossamer-threads.com/...cations/Version_2.x/ you will find another mod called "Review 1.0 Mod" that allows user reviews.

I hope this helps.
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
I got almost everything to work. I use Site_html.pl and cannot get this to work. Can someone please help? . . .


Thank you.

Lpluby

------------------


Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
Hello all!

Bobsie, or anyone else:

I have implemented this mod with full success (I have added 6 review fields for my customized detailed review). As of now it is necessary for the review to be added manualy be the admin.
I was thinking that this should be possible via the modification routine, though, also. I was thinking something like calling the modification template with a tag in the link templete via something like this:

<a href="<%db_cgi_url%>/modify.cgi?ID=<%ID%>">

Then in the modify.html template you would have only the fields for the review available to be modified.

Would something of this fashion work? I would really like to automate the review process some more. Thank you!

Mike
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
Has anyone found a solution or even encountered this problem?
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
MikeB,

This mod is designed to be done manually be the admin. There is another Review mod that is more automated in the Resource Center.

Since I didn't write, nor do I use, this mod, I really cannot answer any questions about it. Have you attempted to contact the author?
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
How would you edit the code so that any user can post a review using this script?

------------------
BeatBox Entertainment
beat-box.com
Ron Newbigging

Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
Ron,

You wouldn't. That is not what this review mod is for. The other review mods being worked on or discussed will do that. This is strictly and admin-only review mod.
Quote Reply
Re: Adding Admin Review Mod - Step-by-step In reply to
What would be the code for adding a review for non template users.


Thanks,

Lpluby