Gossamer Forum
Home : Products : Links 2.0 : Customization :

disclaimer page

(Page 1 of 2)
> >
Quote Reply
disclaimer page
do you know if there is a possibility to send visitor on a disclaimer page if you want to visit one page ??

thank in advance for your help

Quote Reply
Re: disclaimer page In reply to
Could you be more specific?

Do you want to display a disclaimer before your homepage, or before jump.cgi?
Why don't use 'standard' html? (First make a link to disclaimer.html and from disclaimer to home.html)


Quote Reply
Re: disclaimer page In reply to
I would like to create a new subcaterogy where when people will click on it a disclaimer will appear before they can enter in it.


Quote Reply
Re: disclaimer page In reply to
That could be quite trickly unless I am overlooking something. It would be much easier to add the disclaimer page just after they click the jump.cgi link before they visit the site. Will that be OK or do you specifically want it before they enter the category page?

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

Quote Reply
Re: disclaimer page In reply to
Wouldn't be that hard to do copy the code below and save as disclaimer.cgi:

#!/usr/bin/perl

eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \

require "admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/category.def";
};
if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
}

# ========================================================

eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.

sub main {
#-------------------------------------------------------------------
local (%in) = &parse_form;
my (%rec) = &get_record ($in{'ID'});

print "Content-type: text/html\n\n";
print qq|

<html>
<head>
<title>
Before Entering
</title>
</head>
<body text="#000000" bgcolor="#333333" link="#3333ff" vlink="#ffffff" alink="#ffffff" TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">

<table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="100%" BGCOLOR="#ffffd2" >
<tr> <td> <center><table BORDER=0 COLS=1 WIDTH="100%" > <tr> <td BGCOLOR="#ffff99">
<font size=-1 color="000000">
Before entering you must agree to the following:

</font></td> </tr> <tr> <td>
<font size=-1 color="000000">
Before going onto $rec{'Name'}

$rec{'Description'}





<b><a href ="$build_root_url/$rec{'Name'}">(I agree)</a> <a href ="$build_root_url/$rec{'Name'}">(I disagree)</a></b>




</font>
</td> </tr> </table></center> </td> </tr> </table>
</body>
</html>

|;
}




Then instead of linking directly to the category in print cat. You'd link to discliamer.cgi?ID=<%ID%>

Where <%ID%> is the category id.

This is all just a suggestion off the top of my head so it should work fine but you might want to make some alterations to it.


Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: disclaimer page In reply to
Oh yeah that would be fairly easy but I think he asked to go to the disclaimer page for just one category that he is about to add, not all.......

In Reply To:
.....send visitor on a disclaimer page if you want to visit one page ??
.....unless I misunderstood what was being asked.

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

Quote Reply
Re: disclaimer page In reply to
'send visitor on a disclaimer page if you want to visit one page ??'

Yep if you want to do that, could just put a simple if statement in print cat in site_html_templates.pl so that if the category name eq "that category" make the link to disclaimer.cgi?ID=...

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: disclaimer page In reply to
Oh yeah, I didn't think about that, I was trying to think of ways of doing it using tags.....duh.


How about......

if ($category_name =~ /^Category$/) {
$output .= qq|<dl><dt><strong><a class="link" href="/cgi-bin/disclaimer.cgi">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
}
else {
$output .= qq|<dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
}



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

Quote Reply
Re: disclaimer page In reply to
Almost but I just remembered that the category id number is needed and so would need something like this, also I think $subcat would need to be used instead of $category_name:

my $category_dis = "category name you want to use here";

if ($subcat =~ /^$category_dis/) {

open (DB, "<$db_category_name") or &cgierr("unable to open database: $db_category_name. Reason: $!");
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);

next unless ($values[1] eq "$subcat");
$id_num = $values[0];
last LINE;
}
close DB;

$output .= qq|<dl><dt><strong><a class="link" href="/cgi-bin/disclaimer.cgi?ID=$id_num">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
}
else {
$output .= qq|<dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
}



Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: disclaimer page In reply to
What if you had several categories that you wanted to use this disclaimer for? Could you do the my thing like this:

my $category_dis = "Cat1,Cat2,Cat3";

Thanks!

DT


Quote Reply
Re: disclaimer page In reply to
I'd use an array....

my @cats = qw( name1 name2 name3 name4 );

foreach (@cats) {
if ($subcat =~ /^$_/) {



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

Quote Reply
Re: disclaimer page In reply to
Yeah an array would work fine. Then all you'd need to do is use a foreach statement to go thru each name in that array.

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: disclaimer page In reply to
thank you all for you help but i am a little bit lost now...where shoud i put all the different code ?? Ok I have create disclaimer.cgi but when it is called ?? I use html_template + yahoo mod + non english mod.

thank in advance

Quote Reply
Re: disclaimer page In reply to
Go into site_html_templates.pl and find the sub print cat near the bottom.

Once in this sub find:

my (@subcat) = @_;

Underneath it add:

my @categories = ('cat1','cat2');



Find:

foreach $subcat (sort @subcat) {

Underneath it add:

foreach $category_dis (@categories){
if ($subcat =~ /^$category_dis/) {

open (DB, "<$db_category_name") or &cgierr("unable to open database: $db_category_name. Reason: $!");
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);

next unless ($values[1] eq "$subcat");
$id_num = $values[0];
last LINE;
}
close DB;
$url = "$db_cgi_url/disclaimer.cgi?ID=$id_num";
}
}


Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: disclaimer page In reply to
sorry but it doesn't work..What i don't understand is when you definite "my @categorie" but nothing about "category_dis"

to be more simple here is my sub cat print.

sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
# $url : The URL to go to that category
# $category_name : The category name with _ and / removed.
# $category_descriptions{$subcat}: The category description (if any).
# $numlinks : The number of links inside that category (and subcategories).
# $mod : The newest link inside of that category.
#

my (@subcat) = @_;
my @categories = ('Vice_et_Versa');
my $category_dis
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i, $nonenglish);
my ($half) = int (($#subcat+2) / 2);
my $font = 'Font face="Times New Roman, Arial, Helvetica" Size=3 Color=#000066';
my $font_1 = 'Font face="Times New Roman, Arial, Helvetica" Size=2 Color=#000066';



# Print Header.
#$output = qq|<div class="margin"><table width="99%" border="0" cellspacing="1" cellpadding="0"><tr><td class="catlist" valign="top">\n|;
$output = qq|<table width="470" align="center" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" width="50%"><font face="Times New Roman">\n|;

foreach $subcat (sort @subcat) {
foreach $category_dis (@categories){
if ($subcat =~ /^$category_dis/) {

open (DB, "<$db_category_name") or &cgierr("unable to open database: $db_category_name. Reason: $!");
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);

next unless ($values[1] eq "$subcat");
$id_num = $values[0];
last LINE;
}
close DB;
$url = "$db_cgi_url/disclaimer.cgi?ID=$id_num";
}
}
my $mod = $stats{"$subcat"}[3];
my $new_add = $stats{"$subcat"}[4];
($nonenglish) = @{$category{$subcat}}[8];
($subcatstyle) = @{$category{$subcat}}[9];

# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($nonenglish eq "") {
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
}
else {
$category_name = &build_last_title_mb($nonenglish);
}
$numlinks = $stats{"$subcat"}[0];
# $mod = $stats{"$subcat"}[1];

# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).
if ($i == $half) {
$output .= qq|</td><td class="catlist" valign="top">\n|;
}
$i++;

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq| $bouton|;
$output .= qq|<$font><b><a class="catlist" href="$url">$category_name</font></b></a>|;
if ($new_add eq "Yes") {
$days_old = &days_old($stats{"$subcat"}[2]);
if ($days_old <= 14) { $output .= qq| $new_1|; }
}
if ($mod eq "Yes") { $output .= qq~ $updated~; }
# $output .= qq|<dt>|;
$output .= qq|<BR>|;
if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $style) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq~ ~ if ($style eq "1");
foreach $category_name (@subcatsub) {
foreach (sort @{$subcategories{$subcat}}) {
($subcatstyle eq "ALL" && $#subcatsub == 0) ?
($_ =~ m,.*/([^/]+)$, and $category_name = &build_clean($1)) :
($_ eq "$subcat/$category_name" or next);
if ($style eq "1") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($style eq "1");
$output .= qq~ ~ if ($style eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<$font_1><a class="subcat" href="$url">$category_name</a></font>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~...~ if ($style eq "1");
}
$output .= qq|<dt>|;
$output .= qq|<BR>|;
}
else { }}
# Don't forget to end the table..
$output .= "</td></tr></table></div>\n";
return $output;
}

an other question why we don't maje a test only on the jump

when ckick on "cat" then go to a page when people agree or disagree before enter.

Sorry for all these questions.

thank in advance

Quote Reply
Re: disclaimer page In reply to
Why didn't it work?

You need a comma here for starters.....

my $category_dis;


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

Quote Reply
Re: disclaimer page In reply to
Well for a start you should change:

my $category_dis

To:

my $category_dis;

Or just include it in the rest like:


my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i, $nonenglish, $category_dis);



Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: disclaimer page In reply to
'What i don't understand is when you definite "my @categorie" but nothing about "category_dis"'

Because later on your using foreach $category_dis (@categories) {


Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: disclaimer page In reply to
sorry but it still doesn't worry

please help

Quote Reply
Re: disclaimer page In reply to
'sorry but it still doesn't worry'

Can you be a bit more informative. Does it run? Do you get an error message? If so what is it? Does it run but not change it for that category?

It's hard to help if I don't know what the errors are...

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: disclaimer page In reply to
Sorry for haven't give you more information about what doesn't work. In fact, first of all Ihave create disclaimer.cgi and it works because I have tried it. In a second time I have made some modification in sub print_cat of site_html_template.pl.
When I rebuilt my base and I try it I have no error message and no new action which happened. It is like the system does not take in consideration any changes.

My need is only to make a test on one category 'vice et versa' which is on the home page (my site is http://www.selectilinks.com ). If you have more question please do not hesitate. I can even give you acces to my FTP if you want.

Thank in advance for your help

jmligner@selectilinks.com or
jmligner@generale-location.fr



Quote Reply
Re: disclaimer page In reply to
Hi!

i would like to use "disclaimer.cgi" before they enter add.html (add.cgi) and the they Agree or Not Agree ...

is there a way to use any mod or something ?

thanx


Gregor
www.vstopnice.com
www.balonarstvo.com
www.e-nepremicnine.com
Quote Reply
Re: disclaimer page In reply to
Why create a secondary CGI script, when you can simply add conditional statements in the sub main of add.cgi. You have been using this program for more than nine months...I assume you know what I mean when I say "conditional statements".

To see an example, go to:

http://members.anthrotech.com/

Then click on Create Account...(I have auto-submission filters turned on, so, I cannot provide a direct link).

Regards,

Eliot Lee
Quote Reply
Re: disclaimer page In reply to
'When I rebuilt my base and I try it I have no error message and no new action which happened. It is like the system does not take in consideration any changes.'

When you view the main page have you pressed refresh on the browser so your seeing the latest version?

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: disclaimer page In reply to
hI!
Exactly what i want :)
Yes i am user of links for about nine months (uauu time flies) and i have modified my links with cca 15 mods ... works great.
I'm novice in perl and all i got learned was when i got installed my links by friend from this forum and then i was left on my own .. i read hundreds of threads, made hundreds mistakes, correct them, actually all i have now is made with a lot of help from this forum.
But, if you tell me to make a little script or mod for this or for that i dont know how to do it :(
So i politly ask you if you can tell me how to do this disclaimer which one you have.

Thanx a lot in advance



Gregor
www.vstopnice.com
www.balonarstvo.com
www.e-nepremicnine.com
> >