Gossamer Forum
Home : Products : Links 2.0 : Customization :

how do I add multiple check boxes to add.html

Quote Reply
how do I add multiple check boxes to add.html
I'm using the yahoo mod and need to add a few questions to add.cgi/add.html, the most important one being "Do you use an AVS (check all that apply). So, I need about 6 check boxes of which i understand the html aspect but how would i go about creating custom variables for this AND how would i bring my existing database of 350 sites into line with the new variables since when they were added there was no question (still isn't) regarding AVS? I'm hoping that I'm reinventing the wheel here and that someone can point me to step by step instructions; my search wasn't too helpful.

If you care to look at my site and aren't offended by the title and suggestive banners, you'll see why I need to add the AVS question so that I can move the sites into the other catagories such as "Webcams, fetish, bears.. etc..

I know someone has the answer out there for me!

Thanks in advance!

Mark in Beautiful Vancouver, British Columbia
(home of Gossamer Threads.. WooHoo, great local talent)

Quote Reply
Re: how do I add multiple check boxes to add.html In reply to
I deleted your duplicate thread - not sure if it was an accident or not but it's gone anyway...

How about using a select field instead - much easier...

AVS => [14, 'alpha', 10, 10, 1, 'Yes', 'Value|Value|Value|Value']

You can add as many "values" as you want.

Then add this to system defaults...

AVS => 'Desired Default Value'

Then....

AVS => 'Value,Value,Value,Value'

List all the values you used above. You will see where to add all this stuff when you open links.def

You would need to update links.db by adding an extra pipe at the end of each record - there are script available for doing this - maybe in the resources section of search for something like "add fields links.db"



Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

Quote Reply
Re: how do I add multiple check boxes to add.html In reply to
I did all of the above and as for the database I did a global find and replace for |Yes| and replaced with |Yes|| and did the same with |No| since that was the last field in the existing database field. The error I got is below.

CGI ERROR
==========================================
Error Message : fatal error: syntax error at c:/inetpub/gayfucksitesnet/cgi-bin/admin/links.def line 37, near "AVS"
syntax error at c:/inetpub/gayfucksitesnet/cgi-bin/admin/links.def line 74, near "AVS"
syntax error at c:/inetpub/gayfucksitesnet/cgi-bin/admin/links.def line 82, near "isNew"

Script Location : C:\Inetpub\gayfucksitesnet\cgi-bin\admin\admin.cgi
Perl Version : 5.00503

Form Variables
-------------------------------------------
add_form : 1
db : links

Environment Variables
-------------------------------------------
ALLUSERSPROFILE : C:\Documents and Settings\All Users.WINNT
COMMONPROGRAMFILES : C:\Program Files\Common Files
COMPUTERNAME : COMPUTER
COMSPEC : C:\WINNT\system32\cmd.exe
NUMBER_OF_PROCESSORS: 1
OS : Windows_NT
OS2LIBPATH : C:\WINNT\system32\os2\dll;
PATH : C:\Perl\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Symantec\pcAnywhere\
PATHEXT : .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE: x86
PROCESSOR_IDENTIFIER: x86 Family 6 Model 6 Stepping 5, GenuineIntel
PROCESSOR_LEVEL : 6
PROCESSOR_REVISION : 0605
PROGRAMFILES : C:\Program Files
QUERY_STRING : db=links&add_form=1
REQUEST_METHOD : GET
SYSTEMDRIVE : C:
SYSTEMROOT : C:\WINNT
TEMP : C:\WINNT\TEMP
TMP : C:\WINNT\TEMP
USERPROFILE : C:\Documents and Settings\Default User.WINNT
WINDIR : C:\WINNT

I'm fairly adept at modifying perlscripts (UBB, AutoRankPro and doing mods (with instructions of course) to Links 2.0. So, I've learned to ALWAYS backup the files before making any modifications 'cuz if something can screw up, it always does when you I don't have a backup.
Anymore ideas? Have I overlooked something important here or should I perhaps solicit someone with more experience then myself for a paid modification?

Regards,


Quote Reply
Re: how do I add multiple check boxes to add.html In reply to
Could you make links.def accessible so we can take a look.

Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

Quote Reply
Re: how do I add multiple check boxes to add.html In reply to
I'm going by memory here as i quickly restored my backup :)
I do have a handly little perl book that is my reference, from it I learned if I want quotes in html I need a \ first and a few other tidbits. I guess I'm a bit of a newbie. The site is getting a lot of traffic so i editted the database and the links.def at the same time then saved both at the same second so as to minimize lost traffic, now i'm scared :( Here's my links.def file.

# -------------
# Links
# -------------
# Links Manager
#
# File: links.def
# Description: Contains the database definition for links.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.01
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================

# Database Definition: LINKS
# --------------------------------------------------------
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']
AVS => [14, 'alpha', 10, 10, 1 , 'Yes', 'AC|GMP|UGAS']
);

# Database file to use -- defined in links.cfg.
$db_file_name = $db_links_name;
# Counter file to use -- defined in links.cfg.
$db_id_file_name = $db_links_id_file_name;
# The column name for the database key.
$db_key = 'ID';
# Database delimeter.
$db_delim = '|';
# Title used in admin output.
$html_title = 'Links Database';
$html_object = 'Link';

# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 8; $db_isnew = 9; $db_ispop = 10;
$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;
$db_votes = 12; $db_rating = 11; $db_mail = 13;

# Field number to sort links by:
$db_sort_links = 1;

# Field names you want to allow visitors to search on:
@search_fields = (1,2,5);

# System defaults. When adding new links or modifying links, these fields
# can not be overwritten by a user.
%add_system_fields = (
isNew => 'No',
isPopular => 'No',
Hits => '0',
Rating => 0,
Votes => 0,
ReceiveMail => 'Yes'
AVS => 'No'
);

# Hash of column names to possible options. If you want to use a select form
# field, you can use &build_select_field in your HTML page. This routine will
# make a <SELECT> input tag using the following values:
%db_select_fields = (
isNew => 'Yes,No',
isPopular => 'Yes,No',
ReceiveMail => 'Yes,No'
AVS => 'AC|GMP|UGAS'

);

# Hash of column names to radio values. If you use &build_radio_field, it will
# make a <INPUT TYPE="RADIO"> tag for you using the options specified in the hash.
%db_radio_fields = ( );

# Maximum number of hits returned in a search. Can be overridden in the search
# options.
$db_max_hits = 10;

# Use the built in key tracker.
$db_key_track = 1;

# ===========================================================================
# Build up some variables from your definitions. Internal use only.
@db_cols = ();
foreach (sort { $db_def{$a}[0] <=> $db_def{$b}[0] } keys %db_def) {
push (@db_cols, $_);
$db_sort{$_} = $db_def{$_}[1];
$db_form_len{$_} = $db_def{$_}[2];
$db_lengths{$_} = $db_def{$_}[3];
$db_not_null{$_} = $db_def{$_}[4];
$db_defaults{$_} = $db_def{$_}[5];
$db_valid_types{$_} = $db_def{$_}[6];
($_ eq $db_key) and $db_key_pos = $db_def{$_}[0];
}

1;

Quote Reply
Re: how do I add multiple check boxes to add.html In reply to
Your missing a comma after all of the receive mail lines:

ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],

ReceiveMail => 'Yes',

ReceiveMail => 'Yes,No',

You also need to add $db_avs = 14;
Quote Reply
Re: how do I add multiple check boxes to add.html In reply to
Oh yeah, you might want to remove your link from the first post.....I think there are minors that come to this forum and it might be offensive to others (not the site...I didn't even go there) just the fact that there is a link. Just a thought......

Quote Reply
Re: how do I add multiple check boxes to add.html In reply to
Thanks Domenic,
I'll try to edit my initial message to remove the link to my site. I haven't yet tried making the mods that you suggested a day or two ago simply becuase my site's been too busy (I've had 500 sites signup for it in just two weeks of existance). I'm waiting for things to settle down a bit then i'll try once again and hopefully not screw it up this time. yes, i know, the longer I wait though, the more entries (480 and growing quickly) that i have to recatagoize and set up my AVS fields for. :)