# ------------- # Links # ------------- # Links Manager # # File: Upgrade.txt # Description: Upgrading from Links 1.x # Author: Alex Krohn # Email: alex@gossamer-threads.com # Web: http://www.gossamer-threads.com/ # Version: 2.01 # # Copyright 1998 Gossamer Threads Inc. All Rights Reserved. # 1. Upgrade Instructions ==================================================== Because of the significant changes in 2.0 (almost all the code has changed from 1.x), you will need to install 2.0 completely. Don't try and merge the changes! PLEASE NOTE: With Links 2.0 you are required to include the link: "Links Engine Powered By: Gossamer Threads Inc." and have it linked to "http://gossamer-threads.com/scripts/links/". Please see the README for more details. To upgrade: 1. Install 2.0 as outlined in the README. 2. Copy your links.db, categories.db and site_html.pl overtop of of the new versions. 3. If you are upgrading from Links 2.0 beta 5, please use update_beta.pl. For all other versions use update.pl: Links 2.0 now has ratings, and you no longer need the word NULL everywhere. You can run the supplied update.pl script to add the two fields to your links.db file and remove the NULL from links.db. Just copy the script to your data directory and run it either from the web or telnet. A links2.db file will be created, once you've checked that it is ok, you can replace your old links.db file with this new one. 4. Edit your category.db and remove the word 'NULL' (as well as your links.db if the script hasn't already removed them). The new database engine doesn't need this. 5. You will need to cut and paste the following into your site_html.pl. These are for screens that didn't appear in 1.x. You might want to give templates a try if you found editing the site_html.pl file painful. # BEGIN # ------------------------------------------------------------ sub site_html_mailing { # -------------------------------------------------------- # This routine displays your mailing list subscribe/unsubscribe form. # my $action = shift; my $message; ($action eq 'subscribe') and ($message = qq~You've been successfully subscribed to the mailing list!~); ($action eq 'unsubscribe') and ($message = qq~You've been successfully removed from the mailing list!~); &html_print_headers; print qq~ $site_title: Email Updates

$site_title: Email Updates

$site_menu

$message

Keep informed of new additions to $site_title, by subscribing to our low-volume newsletter that will deliver new listings straight to your inbox!

to the list
Name: Email:

$site_footer ~; } sub site_html_mailing_error { # -------------------------------------------------------- # This routine is displayed if there was a problem subscribing. # my $error = shift; &html_print_headers(); print qq~ User Error

Oops, there was a problem!

Error: $error

Please go back to fix the problem.

~; } sub site_html_detailed { # -------------------------------------------------------- # This routine will build a single page per link. It's only # really useful if you have a long review for each link -- # or more information then can be displayed in a summary. # my %rec = @_; $output = qq~ $site_title: $rec{'Title'}

$title_linked

$site_title: Detailed View!

$site_menu

$rec{'Title'}

$rec{'Description'}

Submitted by: $rec{'Contact Name'} -- $rec{'Contact Email'}
Hits: $rec{'Hits'}

Visit this link. $site_search $site_footer ~; return $output; } ########################################################## ## Rate Resources ## ########################################################## sub site_html_ratings { # -------------------------------------------------------- # This routine determines how the top rated page will look like. # You can use: # $top_rated : a three column table without and
tags. # $top_votes : a three column table without and
tags. # # my %rec = @_; &html_print_headers; my $output = qq~ <$dtd> $site_title: Top Rated <$css> <$site_body>

$site_title: Top Rated

$site_menu

Top 10 Resources (by Rating)

$top_rated
Rating# VotesResource

Top 10 Resources (by Votes)

$top_votes
Rating# VotesResource
$site_search $site_footer ~; return $output; } sub site_html_rate_form { # -------------------------------------------------------- # This routine determines how the rate form page will look like. # my %rec = @_; &html_print_headers; print qq~ <$dtd> $site_title: Rate a Resource <$css> <$site_body>

$site_title: Rate a Resource

$site_menu

Please rate the link $rec{'Title'} between one and ten, with ten being tops.

$site_search $site_footer ~; } sub site_html_rate_success { # -------------------------------------------------------- # This routine determines how the add failure page will look like. You have # access to the following variables: # # %in : the variables used to add the link, useful in confirming what was # added. # &html_print_headers; print qq~ <$dtd> $site_title: Resource Rated <$css> <$site_body>

$site_title: Resource Rated

$site_menu

Thank you for your vote.

$site_search $site_footer ~; } sub site_html_rate_failure { # -------------------------------------------------------- # This routine determines how the rate failure page will look like. You have # access to the following variables: # # $errormsg : A bulleted list of the problems. # my $errormsg = shift; &html_print_headers; print qq~ <$dtd> $site_title: Error Rating Resource. <$css> <$site_body>

$site_title: Error Rating Resource

$site_menu

Sorry, but we were unable to rate the resource for the following reason:

$errormsg

Please contact the site administrator if you have any questions.

$site_search $site_footer ~; } # ------------------------------------------------------------ # END There are also some minor site_html.pl issues: 1. In search results page, $next is no longer just a URL, but rather a series of links. So replace '$next_hits' with just 'Pages: $next'. 2. You will need to add a link to the email update script somewhere in your toolbar: http://yoursite.com/cgi-bin/subscribe.cgi That should be it! If you have any troubles, please post a message on the Links beta forum at: http://gossamer-threads.com/scripts/forum/ Cheers, Alex