PDA

View Full Version : everyauction script help


kellyt3
02-24-2009, 05:09 AM
I'm a rank beginner when it comes to php and perl scripts. I downloaded this free script called everyauction and I believe I installed it correctly, as it is viewable up until a point. I use hostmonster for my files. I put the code in the cgi-bin and set the permissions to 744. The first part of the code looks like this:

#!/usr/local/bin/perl
use vars qw(%config %category %form);
use strict;
#-###########################################################################
#
# In accordance with the GPL, this copyright notice MUST remain intact:
#
# EveryAuction Release Version 1.53 (2/17/02)
# Copyright (C) 2000-2002 EverySoft
# Registered with the United States Copyright Office, TX5-186-526
# http://www.everysoft.com/
#
#-###########################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#-###########################################################################
#
# Modification Log (please add new entries to bottom):
#
# * 02/2000
# Matt Hahnfeld (matth@everysoft.com) - Original Concept and Design
# Version available from http://www.everysoft.com/
#
# * MM/YYYY
# Name (email) - Modification
# Availability
#
#-###########################################################################

#-#############################################
# Configuration Section
# Edit these variables!
local %config;

# The Base Directory. We need an
# absolute path for the base directory.
# Include the trailing slash. THIS SHOULD
# NOT BE WEB-ACCESSIBLE!

$config{'basepath'} = '/public_html/stampannex/cgi-bin/auction/';

# Closed Auction Directory
# This is where closed auction items are stored.
# Leave this blank if you don't want to store
# closed auctions. It can potentially take
# up quite a bit of disk space.

$config{'closedir'} = 'closed';

# User Registration Directory
# This is where user registrations are stored.
# Leave this blank if you don't want to
# require registration. It can potentially
# take up quite a bit of disk space.

$config{'regdir'} = 'reg';

# List each directory and its associated
# category name. These directories should
# be subdirectories of the base directory.

%category = (
africa => 'Africa',
asia => 'Asia',
australia => 'Australia',
europe => 'Europe',
namerica => 'North America',
samerica => 'South America',
);


I am unable to create categories for my action. I get the message:
Error:
Category directory africa could not be opened.
I thought the code was supposed to create the category, but maybe there is something I'm not understanding. Please help me out.

bazz
02-24-2009, 05:38 AM
welcome to CF.

id this line set up correclty for where your cgi-bin is?


$config{'basepath'} = '/public_html/stampannex/cgi-bin/auction/';


Does that directory exist?


bazz

kellyt3
02-24-2009, 06:13 AM
Oops. The "auction" folder wasn't in cgi-bin it was just in /public_html/stampannex/auction. I deleted it and put it in cgi-bin. Now, the problem is the folder keeps appearing in the previous place and contains 3 folders: Africa, Asia, and Australia. It's not generating the other 3 folders and it seems to be in the wrong place. Also, when I view it at http://www.stampannex.com/cgi-bin/auction.pl I'm still getting that same error message. I'm not sure where I'm making the mistake. Thanks for your help.

bazz
02-24-2009, 07:16 AM
well you'll need to show the code which deos the work of creating the directories. in it, you should see another location into which the directories will be put. along the lines of the last one above. I'll take a guess that it'll be near some text opendir or mkdir, so that should make it easier to find.


bazz

KevinADC
02-24-2009, 05:55 PM
beware, everyauction scripts can be very long and quite complex depending on how many addon modules it is using or customization it has.

kellyt3
02-28-2009, 10:02 AM
I think this is the information for creating the directory:


sub dispcat {
print "<H2>Auction Categories</H2><TABLE WIDTH=100\% BORDER=1>\n";
print "<TR><TD ALIGN=CENTER BGCOLOR=$config{'colortablehead'}><B>Category</B></TD><TD ALIGN=CENTER BGCOLOR=$config{'colortablehead'}><B>Items</B></TD></TR>";
my $key;
foreach $key (sort keys %category) {
umask(000); # UNIX file permission junk
mkdir("$config{'basepath'}$key", 0777) unless (-d "$config{'basepath'}$key");
opendir DIR, "$config{'basepath'}$key" or &oops("Category directory $key could not be opened.");
my $numfiles = scalar(grep -T, map "$config{'basepath'}$key/$_", readdir DIR);
closedir DIR;
print "<TR><TD BGCOLOR=$config{'colortablebody'}><A HREF=$ENV{'SCRIPT_NAME'}\?category=$key>$category{$key}</A></TD><TD BGCOLOR=$config{'colortablebody'}>$numfiles</TD></TR>";
}
print "</TABLE>\n";
}

FishMonger
02-28-2009, 11:59 AM
Lets start by adding more info to the error message.

Change:
opendir DIR, "$config{'basepath'}$key" or &oops("Category directory $key could not be opened.");

To:
opendir DIR, "$config{'basepath'}$key" or &oops("Category directory <$config{'basepath'}$key> could not be opened. $!");

That will tell you the full path it's using and why it can't open the dir.

kellyt3
03-03-2009, 10:00 AM
I copied that into the script and the message now says:
Category directory could not be opened. No such file or directory

Auctioneer
09-22-2009, 01:28 AM
General Information:

In case anyone else should run into problems when trying to install or modify EveryAuction based Scripts, I do run a Forum Site dedicated to EveryAuction.

http://www.auction-code.com/

Thank You

Ernie

netroact
09-27-2009, 09:11 PM
Now, tell me that wasn't some smooth seo. Looks like some posters got owned by the Auctioneer. And, no it wasn't me posting that. Gonna put that one in my playbook tho.