Gossamer Forum
Home : Products : Links 2.0 : Customization :

add new fields w/checkboxes

Quote Reply
add new fields w/checkboxes
Hello all together,

I would like to add new checkbox fields. I was using the according FAQ's (http://www.gossamer-threads.com/scripts/resources/Detailed/162.html
) and a thread about adding language fields (http://www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/002723.html)

I added several fields and all was working fine. I don't have a links database, because my site isn't ready.

The problem: I inserted checkboxes in links.def & add.html etc., so I have multiple choices. Now I couldn't use something like this:

<%if Language%>
<img src="/images/<%Language%>.gif">
<%endif%>

in my link.html. <%Language%> could be e.g. "german" or "english"; but if I choose both "german" and "english"? In my links.db it will show up like this:

...|german~~english|...

And after I build pages <%Languages%>.gif will be changed to german|english.gif

Who can help? Perhaps it would be easier to insert a sub-routine sub_html_temnplates.pl like it has been done with the updated & new image mod.

Answers are appreciated.

Phil.
Quote Reply
Re: add new fields w/checkboxes In reply to
That will not work....

Do the following:

1) Download the Enhanced Template.pm codes in the Resource Center and put them in your Template.pm file.

2) Create the following variables at the top of your site_html_templates.pl file before the %globals section:

Code:
$german .= qq|<img src="/path/to/german.gif" alt="German">|;
$english .= qq|<img src="/path/to/english.gif" alt="English">|;

Change the /path/to/ to the virtual path where your images are located.

3) Add the following tag definitions in the %globals section:

Code:
english => $english,
german => $german,

4) In your link.html template file, add the following codes:

Code:
<%if Language eq "german"%>
<%german%>
<%endif%>

AND

Code:
<%if Languag eq "english"%>
<%english%>
<%endif%>

This should work.

Good luck.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: add new fields w/checkboxes In reply to
Thanks for your fast answer!

I have the Enhanced Templates mod already installed and I will follow your instructions. I thought of something like this, but I don't know what I had to change.

Phil.
Quote Reply
Re: add new fields w/checkboxes In reply to
You're welcome.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: add new fields w/checkboxes In reply to
No, you misunderstood me: If I check both options, like follows:

<%if Type1 eq "live" and "nonstop"%>
<%live&nonstop%>
<%endif%>

OR

<%if Type1 ep "live" and " "nonstop" and "reverse"%>
<%live&nonstopt&reverse%>
<%endif%>

Can I modify it this way?

Phil.
Quote Reply
Re: add new fields w/checkboxes In reply to
No.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: add new fields w/checkboxes In reply to
Hi Eliot Lee,

How can I modify it?

Phil.
Quote Reply
Re: add new fields w/checkboxes In reply to
Hi,

another idea: Can I insert the following tags to link.html?

<%if Type1 eq "live"%>
<%if Type1 eq "nonstop">
<%live&nonstop%>
<%endif%>
<%endif%>

I really must confess that I don't have any experience with these codes.

Phil.
Quote Reply
Re: add new fields w/checkboxes In reply to
Nope.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: add new fields w/checkboxes In reply to
Eliot, you're wrong this time. His last example had nested ifs, and the Enhanced Template has this nested feature.
I also use nested ifs on my site templates.

So you can use the following codes:
<%if Type1 eq "live"%>
<%if Type1 eq "nonstop"%>
<%live_nonstop%>
<%endif%>
<%endif%>

Webmaster33

[This message has been edited by webmaster33 (edited March 12, 2000).]
Quote Reply
Re: add new fields w/checkboxes In reply to
No, I am not...

The following tag will not work...

Code:
<%live&nonstop%>

Regards,


------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: add new fields w/checkboxes In reply to
Eliot, it really doesn't work. I tried it. But why doesn't it work. There must be another solution. Do you have an idea?

I tried it this way:

<%if Type1 eq "live"%>
<%if Type1 eq "nonstop"%>
<%live_nonstop%>
<%endif%>
<%endif%>

Webmaster33, are you using "double-if-tags". Does it work on your page?

Phil.
Quote Reply
Re: add new fields w/checkboxes In reply to
Yeah, Eliot, <%live&nonstop%> really doesn't work.
The solution would be:
<%if Type1 eq "live"%>
<%if Type1 eq "nonstop"%>
<%live%><%nonstop%>
<%endif%>
<%endif%>

I hope this is what you would like to do.

Webmaster33
Quote Reply
Re: add new fields w/checkboxes In reply to
Webmaster33, if I use

<%if Type1 eq "live"%>
<%if Type1 eq "nonstop"%>
<%live%><%nonstop%>
<%endif%>
<%endif%>

then probably two links will be inserted. I would like to get only one image link. Here is my modified link.html:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
<p>
<ul>
<li>
<font face="Arial, Helvetica, sans-serif" size="4"><b>
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>" class="link" target="_blank"><%Title%></a></b>
<%if Type1 eq "live"%>
<%live%>
<%endif%>
<%if Type1 eq "nonstop"%>
<%nonstop%>
<%endif%>
<%if Type1 eq "reverse"%>
<%reverse%>
<%endif%>
<%if Type1 eq "live"%>
<%if Type1 eq "nonstop"%>
<%live_nonstop%>
<%endif%>
<%endif%>
<%if Type1 eq "live"%>
<%if Type1 eq "reverse"%>
<%live_reverse%>
<%endif%>
<%endif%>
<%if Type1 eq "nonstop"%>
<%if Type1 eq "reverse"%>
<%nonstop_reverse%>
<%endif%>
<%endif%>
<%if Type 1 eq "live"%>
<%if Type1 eq "nonstop"%>
<%if Type1 eq "reverse"%>
<%nonstop_reverse%>
<%endif%>
<%endif%>
<%endif%>
<%if Type2%>
<img src="/links/pages/images/<%Type2%>.gif" align="absmiddle">
<%endif%>
<%if new_mod_img%>
<%new_mod_img%>
<%endif%>
<%if isPopular%>
<img src="http://www.auktionsservice.de/links/pages/images/pop.gif" alt="BELIEBT!" align="absmiddle">
<%endif%>
<br>
<font size="-2" face="Arial, Helvetica, sans-serif">
<b>URL:</b> <a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>" class="link" target="_blank"><%URL%></a><br>
</font><font face="Arial, Helvetica, sans-serif" size="2">
<%if Description%>
<span class="descript">
<%Description%>
</span>
<%endif%>
</font><br>
<font size="-2" face="Arial, Helvetica, sans-serif">
(<b>Eingetragen am:</b> <%Date%> <b>Hits:</b> <%Hits%> <b>Bewertung:</b> <%Rating%> <b>Stimme(n):</b> <%Votes%> )
<br>
<%rate_img%>
[ <a href="<%db_cgi_url%>/review.cgi?ID=<%ID%>">kommentieren</a> ] - [ <a href="<%db_cgi_url%>/spider.cgi?URL=<%URL%>">spidern</a> ] - [ <a href="<%db_cgi_url%>/recommend.cgi?ID=<%ID%>">empfehlen</a> ] - [ <a href="<%db_cgi_url%>/deadlink.cgi?ID=<%ID%>">melden</a> ]
</font></li>
</ul>
</body>
</html>

Quote Reply
Re: add new fields w/checkboxes In reply to
Do you have separate images for the following?

<%live_nonstop%>
<%nonstop_reverse%>

It seems very confusing what you are attempting to do if you do not have separate images for these tags.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: add new fields w/checkboxes In reply to
Yeah, I have seperate images as follows:

live.gif
nonstop.gif
reverse.gif
live_nonstop.gif
live_reverse.gif
nonstop_reverse.gif
live_nonstop_reverse.gif
Quote Reply
Re: add new fields w/checkboxes In reply to
And you have defined all these images in the site_html_templates.pl file before the %globals section??

If so, I really don't know why the nested conditional statements aren't working.

Since they are not working, do the following:

1) Create the following image variables at the top of your site_html_templates.pl file before the %globals section:

Code:
$live .= qq|<img src="/path/to/live.gif" alt="Live">|;
$nonstop .= qq|<img src="/path/to/nonstop.gif" alt="Non-Stop">|;
$reverse .= qq|<img src="/path/to/reverse.gif" alt="Reverse">|;
$live_nonstop .= qq|<img src="/path/to/live_nonstop.gif" alt="Live Non-Stop">|;
$live_reverse .= qq|<img src="/path/to/live_reverse.gif" alt="Live Reverse">|;
$nonstop_reverse .= qq|<img src="/path/to/nonstop_reverse.gif" alt="Non-Stop Reverse">|;
$live_nonstop_reverse .= qq|<img src="/path/to/live_nonstop_reverse.gif" alt="Live Non-Stop-Reverse">|;

2) Then add the following codes at the top of your sub site_html_link routine in the site_html_templates.pl file before the load_template codes:

Code:
if ($rec{'Type1'} eq "live") {
$typeimg = $live;
}
elsif ($rec{'Type1'} eq "nonstop") {
$typeimg = $nonstop;
}
elsif ($rec{'Type1'} eq "reverse") {
$typeimg = $reverse;
}
elsif (($rec{'Type1'} eq "live") && ($rec{'Type1'} eq "nonstop")) {
$typeimg = $live_nonstop;
}
elsif (($rec{'Type1'} eq "live") && ($rec{'Type1'} eq "reverse")) {
$typeimg = $live_reverse;
}
elsif (($rec{'Type1'} eq "nonstop") && ($rec{'Type1'} eq "reverse")) {
$typeimg = $nonstop_reverse;
}
elsif (($rec{'Type1'} eq "nonstop") && ($rec{'Type1'} eq "reverse") && ($rec{'Type1'} eq "live")) {
$typeimg = $nonstop_reverse;
}
else {
$typeimg .= qq|No Image|;
}

3) Then define the following tag:

Code:
typeimg => $typeimg

4) Then add the following tag in your link.html template file:

Code:
<%typeimg%>

REALLY HOPE this works this time!

Regards,


------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: add new fields w/checkboxes In reply to
What do you mean it didn't work?? Do any image codes show up in the HTML source code? Or do broken images show up?

WHAT?

Be more specific.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: add new fields w/checkboxes In reply to
Sorry for asking again, but it doesn't work. I only changed typeimg to type1img and followed exactly your four steps. I chmoded all directopries to 777, so it should work, if it is OK. Hre is the beginning of my site_html_templates.pl:



# -------------
# Links
# -------------
# Links Manager
#
# File: site_html.pl
# Description: This library contains all the HTML that will be generated in
# the finished directory.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
# This file contains a modification to allow nonenglish characters in categorynames
# Author: Matthias Berndt
# Email: Matthias_Berndt@csi.com
# Web: http://www.schachbund.de/links/

# ----------------------------------------------------------------------
# The HTML in this file and the style sheet (links.css) have been authored
# by Chris Croome of webarchitects.
#
# Email: chris@atomism.demon.co.uk
# Web: http://www.webarchitects.co.uk/
# ----------------------------------------------------------------------

# You can put variables here that you would like to use in any
# of your templates.

# ***************************************** new fields modification - begin *****************
$live = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/live.gif" WIDTH=35 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$nonstop = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/nonstop.gif" WIDTH=75 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$reverse = qq|<a href="$db_cgi_url/help.htm#type1"><IMG SRC="$build_root_url/images/reverse.gif" WIDTH=75 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$live_nonstop = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/live_nonstop.gif" WIDTH=150 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$live_reverse = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/live_reverse.gif" WIDTH=150 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$nonstop_reverse = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/nonstop_reverse.gif" WIDTH=150 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$live_nonstop_reverse = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/live_nonstop_reverse.gif" WIDTH=200 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
# ***************************************** new fields modification - end *******************

%globals = (
date => &get_date,
time => &get_time,
db_cgi_url => $db_cgi_url,
build_root_url => $build_root_url,
site_title => $build_site_title,
css => $build_css_url,
banner => '',
# ***************************************** numlinks modification - begin ******************
numlinks => &num_records,
# ***************************************** numlinks modification - end ********************
# ***************************************** numcats modification - begin *******************
numcat => &numcat
# ***************************************** numcats modification - end ********************
);

# ***************************************** updated & new graphic modification - begin ********
$new_1 = qq|<a href="$build_root_url/help.html#new"><img src="$build_root_url/images/new1.gif" border="0" width=35 height=15 alt="NEU: 0-2 Tage alt!" align="absmiddle"></A>|;
$new_3 = qq|<a href="$build_root_url/help.html#new"><img src="$build_root_url/images/new2.gif" border="0" width=35 height=15 alt="NEU: 3-7 Tage alt!" align="absmiddle"></A>|;
$new_7 = qq|<a href="$build_root_url/help.html#new"><img src="$build_root_url/images/new3.gif" border="0" width=35 height=15 alt="NEU: 8-14 Tage alt!" align="absmiddle"></A>|;
$updated = qq|<a href="$build_root_url/help.html#new"><img src="$build_root_url/images/updated.gif" width=75 height=15 border=0 alt="UPDATED: in den letzten 14 Tagen aktualisiert!" align="absmiddle"></A>|;
# ***************************************** updated & new graphic modification - end *********

# ***************************************** numlinks modification - begin ******************
sub num_records {
#-------------------------------------------------------------
# Displays number of records

my $count = 0;

open (DB, "<$db_file_name") or
&cgierr("error in num_records. unable to open database:$db_file_name.\nReason: $!");

LINE: while (<DB> ) {
if (!(/^#/) && !(/^\s*$/)) {
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
++$count;
}
}
close DB;
return $count;
}
# ***************************************** numlinks modification - end *******************
# ***************************************** numcats modification - begin *******************
sub numcat {
#------------------------------------------------------------------
# Displays number of categories

my $count = 0;
open (DB, "<$db_category_name") or
&cgierr("error in numbercat. unable to open database:$db_category_name.\nReason:
$!");
LINE: while (<DB> ) {
if (!(/^#/) && !(/^\s*$/)) {
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
$count;
}
}
close DB;
return $count;
}
# ***************************************** numcats modification - end ********************

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.

my %rec = @_;
# ***************************************** updated & new graphic modification - begin ********
my $days_old;
my $new_mod_img = "";
# ***************************************** updated & new graphic modification - end *********
# ***************************************** ratings by images modification - begin ************
my $rate_img = "";
# ***************************************** ratings by images modification - end *************

# Set new and pop to either 1 or 0 for templates.
# ***************************************** updated & new graphic modification - begin ********
# The record is either New, Updated, or neither. Only a New or Updated
# graphic can be displayed for a link, but never both.
# First, check to see if the link is new.
if ($rec{'isNew'} eq "Yes") {
# Calculate age of link based on Date Added, not Date Modified.
$days_old = &days_old($rec{'DateAdded'});
# Display appropriate New graphic based on age of link.
if ($days_old <= 2) { $new_mod_img = $new_1; }
elsif ($days_old <= 7) { $new_mod_img = $new_3; }
elsif ($days_old <= $db_new_cutoff) { $new_mod_img = $new_7; }
}
# If the link is not new, check to see if it has been updated.
elsif (&compare_dates($rec{'Date'}, $rec{'DateAdded'})) {
# Calculate age of link based on Date Modified, not Date Added.
$days_old = &days_old($rec{'Date'});
if ($days_old <= $db_new_cutoff) { $new_mod_img = qq~ $updated~; }
}
# ***************************************** updated & new graphic modification - end *********

($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
# ***************************************** ratings by images modification - begin ************
$rate_00 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate0.gif" WIDTH=154 HEIGHT=15 ALT="Kommentar abgeben!" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_01 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate1.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_02 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate2.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_03 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate3.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_04 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate4.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_05 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate5.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_06 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate6.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_07 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate7.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_08 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate8.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_09 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate9.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_10 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate10.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_11 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate11.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_12 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate12.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_13 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate13.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_14 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate14.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_15 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate15.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_16 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate16.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_17 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate17.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_18 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate18.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_19 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate19.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$rate_20 = qq|<a href="$db_cgi_url/review.cgi?ID=$rec{'ID'}"><IMG SRC="$build_root_url/images/rate20.gif" WIDTH=154 HEIGHT=15 ALT="Note: $rec{'Rating'}, $rec{'Votes'} Stimme(n)" BORDER="0" ALIGN="ABSMIDDLE"></A>|;

if ($rec{'Rating'} eq '10.00') { $rate_img = $rate_20; }
elsif ($rec{'Rating'} eq '0') { $rate_img = $rate_00; }
elsif ($rec{'Rating'} le '0.50') { $rate_img = $rate_01; }
elsif ($rec{'Rating'} le '1.00') { $rate_img = $rate_02; }
elsif ($rec{'Rating'} le '1.50') { $rate_img = $rate_03; }
elsif ($rec{'Rating'} le '2.00') { $rate_img = $rate_04; }
elsif ($rec{'Rating'} le '2.50') { $rate_img = $rate_05; }
elsif ($rec{'Rating'} le '3.00') { $rate_img = $rate_06; }
elsif ($rec{'Rating'} le '3.50') { $rate_img = $rate_07; }
elsif ($rec{'Rating'} le '4.00') { $rate_img = $rate_08; }
elsif ($rec{'Rating'} le '4.50') { $rate_img = $rate_09; }
elsif ($rec{'Rating'} le '5.00') { $rate_img = $rate_10; }
elsif ($rec{'Rating'} le '5.50') { $rate_img = $rate_11; }
elsif ($rec{'Rating'} le '6.00') { $rate_img = $rate_12; }
elsif ($rec{'Rating'} le '6.50') { $rate_img = $rate_13; }
elsif ($rec{'Rating'} le '7.00') { $rate_img = $rate_14; }
elsif ($rec{'Rating'} le '7.50') { $rate_img = $rate_15; }
elsif ($rec{'Rating'} le '8.00') { $rate_img = $rate_16; }
elsif ($rec{'Rating'} le '8.50') { $rate_img = $rate_17; }
elsif ($rec{'Rating'} le '9.00') { $rate_img = $rate_18; }
elsif ($rec{'Rating'} le '9.50') { $rate_img = $rate_19; }
else { $rate_img = $rate_20; }
# ***************************************** ratings by images modification - end *************
# ***************************************** new fields modification - begin *****************
if ($rec{'Type1'} eq "live") {
$type1img = $live;
}
elsif ($rec{'Type1'} eq "nonstop") {
$type1img = $nonstop;
}
elsif ($rec{'Type1'} eq "reverse") {
$type1img = $reverse;
}
elsif (($rec{'Type1'} eq "live") && ($rec{'Type1'} eq "nonstop")) {
$type1img = $live_nonstop;
}
elsif (($rec{'Type1'} eq "live") && ($rec{'Type1'} eq "reverse")) {
$type1img = $live_reverse;
}
elsif (($rec{'Type1'} eq "nonstop") && ($rec{'Type1'} eq "reverse")) {
$type1img = $nonstop_reverse;
}
elsif (($rec{'Type1'} eq "nonstop") && ($rec{'Type1'} eq "reverse") && ($rec{'Type1'} eq "live")) {
$type1img = $nonstop_reverse;
}
else {
$type1img .= qq|No Image|;
}
# ***************************************** new fields modification - end *******************

return &load_template ('link.html', {
new_mod_img => $new_mod_img,
detailed_url => "$build_detail_url/$rec{'ID'}$build_extension",
# ***************************************** ratings by images modification - begin ************
rate_img => $rate_img,
# ***************************************** ratings by images modification - end *************
# ***************************************** new fields modification - begin *****************
type1img => $type1img,
# ***************************************** new fields modification - end ******************
%rec,
%globals
});
# ***************************************** updated & new graphic modification - end *********
}

Quote Reply
Re: add new fields w/checkboxes In reply to
Nothing shows up: No broken image link or something like this.

Phil.
Quote Reply
Re: add new fields w/checkboxes In reply to
It seems to be a little bit complicate. But nevertheless, maybe someone can help me.

Phil.
Quote Reply
Re: add new fields w/checkboxes In reply to
And you are using <%type1img%> in your template files, right???

------------------
The Immuatable Order of Modding
-=-=-=-=-=-=-=-
1. Read the FAQ, 2. Search the board, 2a. Search the board again, 3. ask the question, 4. back-up, 5. experiment, 6. rephrase question (or better yet, post solution to original question)

Quote Reply
Re: add new fields w/checkboxes In reply to
Hi,

I couldn't find any further infos regarding this theme on the BBS. I made all changes as Eliot told me. Also I'm using <%type1img%> in my link.html file.

Phil.
Quote Reply
Re: add new fields w/checkboxes In reply to
Hey folk,

I got it working and I'm happy; I'm really quite happy. For whom is interested I changed Eliots Code as follows and inserted it under sub site_html_link in site_html_templates.pl:

# ***************************************** new fields modification - begin *****************
$live = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/live.gif" WIDTH=35 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$nonstop = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/nonstop.gif" WIDTH=75 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$reverse = qq|<a href="$db_cgi_url/help.htm#type1"><IMG SRC="$build_root_url/images/reverse.gif" WIDTH=75 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$live_nonstop = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/live_nonstop.gif" WIDTH=150 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$live_reverse = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/live_reverse.gif" WIDTH=150 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$nonstop_reverse = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/nonstop_reverse.gif" WIDTH=150 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$live_nonstop_reverse = qq|<a href="$db_cgi_url/help.html#type1"><IMG SRC="$build_root_url/images/live_nonstop_reverse.gif" WIDTH=200 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;

$b2b = qq|<a href="$db_cgi_url/help.html#type2"><IMG SRC="$build_root_url/images/b2b.gif" WIDTH=35 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$b2c = qq|<a href="$db_cgi_url/help.html#type2"><IMG SRC="$build_root_url/images/b2c.gif" WIDTH=35 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$c2c = qq|<a href="$db_cgi_url/help.htm#type2"><IMG SRC="$build_root_url/images/c2c.gif" WIDTH=35 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$b2b_b2c = qq|<a href="$db_cgi_url/help.html#type2"><IMG SRC="$build_root_url/images/b2b_b2c.gif" WIDTH=75 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$b2b_c2c = qq|<a href="$db_cgi_url/help.html#type2"><IMG SRC="$build_root_url/images/b2b_c2c.gif" WIDTH=75 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$b2c_c2c = qq|<a href="$db_cgi_url/help.html#type2"><IMG SRC="$build_root_url/images/b2c_c2c.gif" WIDTH=75 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;
$b2b_b2c_c2c = qq|<a href="$db_cgi_url/help.html#type2"><IMG SRC="$build_root_url/images/b2b_b2c_c2c.gif" WIDTH=150 HEIGHT=15 ALT="" BORDER="0" ALIGN="ABSMIDDLE"></A>|;

if ($rec{'Type1'} eq "live") {
$type1img = $live;
}
elsif ($rec{'Type1'} eq "nonstop") {
$type1img = $nonstop;
}
elsif ($rec{'Type1'} eq "reverse") {
$type1img = $reverse;
}
elsif ($rec{'Type1'} eq "live|nonstop") {
$type1img = $live_nonstop;
}
elsif ($rec{'Type1'} eq "live|reverse") {
$type1img = $live_reverse;
}
elsif ($rec{'Type1'} eq "nonstop|reverse") {
$type1img = $nonstop_reverse;
}
elsif ($rec{'Type1'} eq "live|nonstop|reverse") {
$type1img = $live_nonstop_reverse;
}
else {
$type1img .= qq&#0124; &#0124;;
}

if ($rec{'Type2'} eq "b2b") {
$type2img = $b2b;
}
elsif ($rec{'Type2'} eq "b2c") {
$type2img = $b2c;
}
elsif ($rec{'Type2'} eq "c2c") {
$type2img = $c2c;
}
elsif ($rec{'Type2'} eq "b2b|b2c") {
$type2img = $b2b_b2c;
}
elsif ($rec{'Type2'} eq "b2b|c2c") {
$type2img = $b2b_c2c;
}
elsif ($rec{'Type2'} eq "b2c|c2c") {
$type2img = $b2c_c2c;
}
elsif ($rec{'Type2'} eq "b2b|b2c|c2c") {
$type2img = $b2b_b2c_c2c;
}
else {
$type2img .= qq&#0124; &#0124;;
}
# ***************************************** new fields modification - end *******************

Another question to someone who is familiar with SSI :-)

Find it here:

http://www.gossamer-threads.com/scripts/forum/resources/Forum8/HTML/001173.html

Phil

Quote Reply
Re: add new fields w/checkboxes In reply to
Good job.

And what do you want to know about SSI?

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums