#!/usr/bin/perl ######################################################################## # COPYRIGHT NOTICE: # # Copyright 2008 FocalMedia.Net All Rights Reserved. # # Selling the code for this program without prior written consent # from FocalMedia.Net is expressly forbidden. You may not # redistribute this program in any shape or form. # # This program is distributed "as is" and without warranty of any # kind, either express or implied. In no event shall the liability # of FocalMedia.Net for any damages, losses and/or causes of action # exceed the total amount paid by the user for this software. # ######################################################################## #### EDIT HERE -- FOR WINDOWS/IIS BASED INSTALLATIONS ONLY ####### $config_cgi = "config.cgi"; ## <-- CHANGE THIS LINE TO THE FULL SERVER PATH TO config.cgi # THE PATH ON A WINDOWS INSTALLATION WILL LOOK SOMETHING LIKE THIS: # $config_cgi = "c:/inetpub/webpub/cgi-bin/pseek/config.cgi"; #### DO NOT CHANGE ANYTHING BELOW THIS LINE ################# #use FindBin; #use lib $FindBin::Bin; use CGI::Carp qw(fatalsToBrowser); use CGI; use DBI; use pseek; use fmspm; &get_setup; fmspm::check_spamb("rssrd.cgi", "header", "$data_dir"); $q = CGI->new; ################# print "Content-type: text/html\n\n"; ### GET SUBDIRS $lnkid = $q->param('id'); $lnkid =~ s/[^0-9]//g; $cat_cid = $q->param('cid'); $cat_cid =~ s/[^0-9]//g; if ($cat_cid eq "") { print "Unexpected Error. Exiting...\n\n"; exit; } if ($mysql_hostname eq ""){$dsn = "DBI:mysql:$db_name";}else{$dsn = "DBI:mysql:$db_name:$mysql_hostname:$mysql_port";} $dbh = DBI->connect($dsn, $db_username, $db_password); if ( !defined $dbh ) {die "Cannot connect to MySQL server: $DBI::errstr\n"; } $sql = "SELECT * FROM dirs WHERE cid = '$cat_cid'"; $sth = $dbh->prepare($sql); $sth->execute; $serror = ""; $serror = $sth->errstr; if ($serror ne "") {die "SQL Syntax Error: $serror";} $cnt = 0; while ( @row = $sth->fetchrow() ) { $ecat = ""; $lv = 0; for ($ms = 2; $ms < 18; $ms++) { if ($row[$ms] ne "") { $lv++; $ecat = $ecat . pseek::encode_dir($row[$ms]) . "/"; $currcat = $row[$ms]; } } } chop($ecat); $gsettings = new_gsettings; if ($gsettings->{more_info_naming} eq "linktitles") { $sql = "SELECT title FROM links WHERE lnkid = '$lnkid'"; $sth = $dbh->prepare($sql); $sth->execute; $serror = ""; $serror = $sth->errstr; if ($serror ne "") {die "SQL Syntax Error: $serror";} while ( @row = $sth->fetchrow() ) { $linktitle = $row[0]; } $more_info_fn1 = pseek::get_more_info_file_name($linktitle); $more_info = "$web_url/$ecat/" . $more_info_fn1 . "_" . $lnkid . $gsettings->{gen_file_ext}; } else { $more_info = "$web_url/$ecat/" . $lnkid . $gsettings->{gen_file_ext}; } $sth->finish; $dbh->disconnect; print qq[