Gossamer Forum
Home : Products : Links 2.0 : Customization :

jump.cgi option

Quote Reply
jump.cgi option
How do you give a link the option for a
jump.cgi link or a detailed page link ???

Is there a mod for this ?

Quote Reply
Re: jump.cgi option In reply to
1)Add a new field to the db called isdetailed (you'll need to update links.def and use the db converter that's posted in this forum). Make it hold the values yes or no
2)Go throught the database changing the value to yes for those links that are detailed (set no as default if most of them are not detailed)
3)In link.html add
<a href=http://whatever.com/cgi<%if isdetailed%>detailed/<%ID%>.html<%endif%>
<%ifnot isdetailed%>jump.cgi?ID=<%ID%><%endif%>

It won't count the hits to detailed. But if you want that to happen, then make another copy of jump.cgi and then change the code in link.html to

<%if detailed%>/jump2.cgi?ID=<%ID%><%endif%>
<%ifnot detailed%>/jump.cgi?ID=<%ID%><%endif%>

and change the jump url in jump2.cgi to whereever your detailed pages are, with the id code left in where it needs to be.

Quote Reply
Re: jump.cgi option In reply to
In Reply To:

you'll need to update links.def
You mean links.db

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: jump.cgi option In reply to
Both isn't it?

Quote Reply
Re: jump.cgi option In reply to
You add the new field to links.def like....

isDetailed => [14, 'alpha', 40, 75, 0, 'http://', '^http']

Then add the extra delimiter at the end of each record in links.db |

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: jump.cgi option In reply to
Does anything in nph-build.cgi
need to be modified ?

Quote Reply
Re: jump.cgi option In reply to
Nope.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: jump.cgi option In reply to
Also in links.def, depending on what your using it for, you might want to add it to the system defaults so that users can't select whether it goes to the detailed page or not.

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: jump.cgi option In reply to
How do you add it to the system defaults so that users can't select whether it goes to the detailed page or not ???


Quote Reply
Re: jump.cgi option In reply to
# 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'
);


In links.def you'll see the above. Just add the field to that.

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: jump.cgi option In reply to
Hi,

I did the following and it still doesnt work

1. I added a new field to the links.def
isDetailed => [14, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']

2. I couldnt find the db converter you talked about but if you can get the link to it for me I would greatly appreciate it

3. Then I added the extra delimiter at the end of each record in links.db |

4. The links.def in the system defaults section I added
isDetailed => 'No'

5. Then below that in the select form field section I added
isDetailed => 'Yes,No'

If I did something wrong please tell me
cause I couldnt get it to work

Thanks

Quote Reply
Re: jump.cgi option In reply to
2. db converter, talked about only yesterday! http://www.gossamer-threads.com/...w=collapsed&sb=5

When you add those lines do you add a , to the end of the line before them?

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: jump.cgi option In reply to
I'm still having problems
But I know what is wrong but dont have the expertise to fix it.

1. field 14 in my links.def I feel is wrong

isDetailed => [14, 'alpha', 10, 10, 1, 'http://', '^http']


2. the code I'm using in link.html I feel is also wrong


here is the code I'm using in my link.html:

<%if isdetailed%>/jump.cgi?ID=<%ID%><%endif%>
<%ifnot isdetailed%>/jump.cgi?ID=<%ID%><%endif%>


Here is a copy of my links.def
If anyone sees anything wrong Please tell me

<pre>

# Database Definition: LINKS
# --------------------------------------------------------
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 10, 12, 1, '', ''],
Title => [1, 'alpha', 80, 900, 1, '', ''],
URL => [2, 'alpha', 80, 900, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '60x5', 9000, 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'],
isDetailed => [14, 'alpha', 10, 10, 1, 'http://', '^http']
);

# 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;
$db_isdetailed = 14;

# 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',
isDetailed => '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',
isDetailed => 'Yes,No'
);

# 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;
</pre>




Quote Reply
Re: jump.cgi option In reply to
Well for starters:

isDetailed => [14, 'alpha', 10, 10, 1, 'http://', '^http']


Is wrong. Your need it to be a yes/no field:

isDetailed => [14, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],




Glenn

Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
Quote Reply
Re: jump.cgi option In reply to
Also you won't get anywhere using this:

<%if isdetailed%>/jump.cgi?ID=<%ID%><%endif%>
<%ifnot isdetailed%>/jump.cgi?ID=<%ID%><%endif%>

The html isn't correct for starters, plus it sends you thru jump.cgi both times!

Should be:


<%if isdetailed%>
<%build_detailed_url%>
<%endif%>
<%ifnot isdetailed%>
<a href = "<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a>
<%endif%>


<%build_detailed_url%> should already be defined in sub link in site_html_templates. If it'sd not you'll need to make some alterations...


Glenn

Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
Quote Reply
Re: jump.cgi option In reply to
In my site_html_templates I didnt find the
<%build_detailed_url%>
cause I did a search for build_detailed_url
and found nothing

In that case Its not defined

What do I need to add in order to make this defined ?

Quote Reply
Re: jump.cgi option In reply to
Sorry it was <%detailed_url%>, here's where it is or goes:


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

my %rec = @_;

# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});

return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}



Glenn

Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
Quote Reply
Re: jump.cgi option In reply to
It turns out what I am looking for is the:
Enable/Disable Hyperlink Mod found at:
http://www.isee-multimedia.co.uk/scripts/links2.htm

So I went there and followed the directions and it worked.

Now the only problem I'm having is the link.html part

The if statement works and the ifnot statement does not work

So I did some searching in the forums and found that I need the Enhanced Template Support mod found at:
http://www.gossamer-threads.com/scripts/resources/Detailed/877.html

I followed the directions for it but it still didnt work

How does the links know to look at the Template.pm ???
Maybe my links isnt pointing to it for the if statements

Quote Reply
Re: jump.cgi option In reply to
Thanks for all your help

This was continued at this post and the error was found
http://gossamer-threads.com/perl/forum/showflat.pl?Cat=&Board=L2Cust&Number=139386&page=0&view=&sb=&part=1&vc=1

Thanks again
Ibrahim