Hello,
I tried to add a new database field calles Status with four possible options Visible,Hidden,Prepared and Deleted. I found a post about that ( http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=209606 ) and did everything.
In the links.def I added in the database definition the following line:
Status => [14, 'alpha', 10, 10, 1, 'Visible', '']
also edited this part:
# 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_status = 14;
Defined system default: Status => 'Visible'
And modified the following code also:
# 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',
Status => 'Visible,Hidden,Prepared,Deleted'
);
My link.html:
<%if (Status eq 'Visible')%>
<dl><dt><strong><a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a></strong>
<%if Description%>
<dd><%Description%>
<%endif%>
<%if isNew%>
<small><sup class="new">new</sup></small>
<%endif%>
<%if isPopular%>
<small><sup class="pop">pop</sup></small>
<%endif%>
<br><small class="date">(Added: <%Date%> Hits: <%Hits%> Rating: <%Rating%> Votes: <%Votes%>) <a href="<%db_cgi_url%>/rate.cgi?ID=<%ID%>">Rate It</a></small>
</dl>
<%endif%>
I wanted to show only the 'Visible' links, but when I generate all pages, the linked title of ALL links are missing. There are only the descriptions. And also the descriptions of the 'Hidden' links. Something like that:
Program to store and easily access addresses and phone numbers. Includes phone dialer.
(Added: 9-Jul-2001 Hits: 1458 Rating: 0 Votes: 0) Rate It Freeware address book replacement for Microsoft Windows 95/98/NT4/2000 and XP. It has many features and tools which make it easy to use, and a simple interface which makes contact management simplified.
(Added: 10-Aug-2003 Hits: 2413 Rating: 0 Votes: 0) Rate It
Does anyone have any idea what can be wrong?
Zdenek
I tried to add a new database field calles Status with four possible options Visible,Hidden,Prepared and Deleted. I found a post about that ( http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=209606 ) and did everything.
In the links.def I added in the database definition the following line:
Status => [14, 'alpha', 10, 10, 1, 'Visible', '']
also edited this part:
# 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_status = 14;
Defined system default: Status => 'Visible'
And modified the following code also:
# 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',
Status => 'Visible,Hidden,Prepared,Deleted'
);
My link.html:
<%if (Status eq 'Visible')%>
<dl><dt><strong><a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a></strong>
<%if Description%>
<dd><%Description%>
<%endif%>
<%if isNew%>
<small><sup class="new">new</sup></small>
<%endif%>
<%if isPopular%>
<small><sup class="pop">pop</sup></small>
<%endif%>
<br><small class="date">(Added: <%Date%> Hits: <%Hits%> Rating: <%Rating%> Votes: <%Votes%>) <a href="<%db_cgi_url%>/rate.cgi?ID=<%ID%>">Rate It</a></small>
</dl>
<%endif%>
I wanted to show only the 'Visible' links, but when I generate all pages, the linked title of ALL links are missing. There are only the descriptions. And also the descriptions of the 'Hidden' links. Something like that:
Program to store and easily access addresses and phone numbers. Includes phone dialer.
(Added: 9-Jul-2001 Hits: 1458 Rating: 0 Votes: 0) Rate It Freeware address book replacement for Microsoft Windows 95/98/NT4/2000 and XP. It has many features and tools which make it easy to use, and a simple interface which makes contact management simplified.
(Added: 10-Aug-2003 Hits: 2413 Rating: 0 Votes: 0) Rate It
Does anyone have any idea what can be wrong?
Zdenek