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
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
# -------------------------------------------
$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.
Step 5: Copy the new db file to the file links uses.
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
[This message has been edited by crisco (edited March 29, 1999).]
[This message has been edited by crisco (edited March 29, 1999).]
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
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
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.oldStep 5: Copy the new db file to the file links uses.
Code:
mv links2.db links.dbStep 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
[This message has been edited by crisco (edited March 29, 1999).]
[This message has been edited by crisco (edited March 29, 1999).]