I been surfing many links sites to get ideas on how I should build mine. I seen a mod that allows one to add favourites sites (using cookies). Where can I find such a mod? Thanks.
May 6, 2001, 6:27 AM
Veteran (19537 posts)
May 6, 2001, 6:27 AM
Post #2 of 66
Views: 15458
Hmm I wonder?
Maybe the resources center or maybe camelsoup.com or maybe even a quick search would produce something!!!!!!
Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/
Maybe the resources center or maybe camelsoup.com or maybe even a quick search would produce something!!!!!!
Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/
May 7, 2001, 6:36 AM
Veteran / Moderator (1203 posts)
May 7, 2001, 6:36 AM
Post #5 of 66
Views: 15466
Ahh but you didn't try the resource center like both Paul and Eliot suggested. If you did you'd have found it here (Portal Links):
http://www.gossamer-threads.com/...rsion_2_x/more4.html
Glenn
Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
http://www.gossamer-threads.com/...rsion_2_x/more4.html
Glenn
Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
May 7, 2001, 7:10 AM
Novice (11 posts)
May 7, 2001, 7:10 AM
Post #6 of 66
Views: 15517
I also am looking for that mod But the portal links mod you found, i also found, has a bad url for the files that goes with it. So what to do with it . I don't know how the portal.txt is build so i cant add something in it cause i don't have one. That's a problem for someone who hasn't that much experience with perl.
regards alfred
regards alfred
May 7, 2001, 8:43 AM
Veteran / Moderator (1203 posts)
May 7, 2001, 8:43 AM
Post #10 of 66
Views: 15527
That example uses the Portal links mod from:
http://www.camelsoup.com
which does do what you were asking for!
Glenn
Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
http://www.camelsoup.com
which does do what you were asking for!
Glenn
Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
May 7, 2001, 8:43 AM
Veteran (17240 posts)
May 7, 2001, 8:43 AM
Post #11 of 66
Views: 15412
REALLY???
LOOK AT THE FOLLOWING SECTION OF THAT WEB PAGE:
Free Modifications
1.Category Link Template
2.Link Comparison
3.PortalLinks 1.0
4.NewsLinks
5.Dynamic External Templates
6.Info.cgi
7.Info.cgi w/ hit counts
8.Organized Link Detail Pages
9.Horizontal Category Links
ARE YOU BLIND???? Time for an eye appointment!
Want to see a fricken example?
Go to the following web site:
http://www.japanreference.com
Yes, uses mylinks.cgi...however, the portal.cgi works the same way!
Regards,
Eliot Lee
LOOK AT THE FOLLOWING SECTION OF THAT WEB PAGE:
Code:
Free Modifications
1.Category Link Template
2.Link Comparison
3.PortalLinks 1.0
4.NewsLinks
5.Dynamic External Templates
6.Info.cgi
7.Info.cgi w/ hit counts
8.Organized Link Detail Pages
9.Horizontal Category Links
ARE YOU BLIND???? Time for an eye appointment!
Want to see a fricken example?
Go to the following web site:
http://www.japanreference.com
Yes, uses mylinks.cgi...however, the portal.cgi works the same way!
Regards,
Eliot Lee
May 7, 2001, 9:15 AM
Veteran (1220 posts)
May 7, 2001, 9:15 AM
Post #12 of 66
Views: 15433
However, at the moment PortalLink 1.0 can't be accessed, neither through the Resource Center nor through Camelsoup.com: Unkown Tag: ID
Thomas
http://www.japanreference.com

Thomas
http://www.japanreference.com
May 7, 2001, 10:26 AM
Veteran / Moderator (1936 posts)
May 7, 2001, 10:26 AM
Post #13 of 66
Views: 15686
Sorry for the confusion folks... the files are where they always were. Directory browsing was just turned off.
The files are located here:
http://www.camelsoup.com/...templates/portal.txt
http://www.camelsoup.com/...ates/portal_add.html
http://www.camelsoup.com/...s/portal_delete.html
http://www.camelsoup.com/...rtal_delete_all.html
http://www.camelsoup.com/...tes/portal_home.html
http://www.camelsoup.com/...es/portal_error.html
http://www.camelsoup.com/...tes/portal_link.html
and here:
http://www.findinghim.com/...templates/portal.txt
http://www.findinghim.com/...ates/portal_add.html
http://www.findinghim.com/...s/portal_delete.html
http://www.findinghim.com/...rtal_delete_all.html
http://www.findinghim.com/...tes/portal_home.html
http://www.findinghim.com/...es/portal_error.html
http://www.findinghim.com/...tes/portal_link.html
and in the forum...
PortalLinks 2.0 is located here:
http://www.camelsoup.com/source/portal.txt
http://www.camelsoup.com/source/portal_add.html
http://www.camelsoup.com/...e/portal_delete.html
http://www.camelsoup.com/...rtal_delete_all.html
http://www.camelsoup.com/...ce/portal_error.html
http://www.camelsoup.com/source/portal_form.html
http://www.camelsoup.com/source/portal_home.html
http://www.camelsoup.com/source/portal_link.html
http://www.camelsoup.com/...ce/portal_login.html
http://www.camelsoup.com/...e/portal_logoff.html
http://www.camelsoup.com/source/portal_reg.html
note: version 2.0 hasn't been updated yet, so there's a few template/tag issues. read the threads on 2.0 for the fix.
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
The files are located here:
http://www.camelsoup.com/...templates/portal.txt
http://www.camelsoup.com/...ates/portal_add.html
http://www.camelsoup.com/...s/portal_delete.html
http://www.camelsoup.com/...rtal_delete_all.html
http://www.camelsoup.com/...tes/portal_home.html
http://www.camelsoup.com/...es/portal_error.html
http://www.camelsoup.com/...tes/portal_link.html
and here:
http://www.findinghim.com/...templates/portal.txt
http://www.findinghim.com/...ates/portal_add.html
http://www.findinghim.com/...s/portal_delete.html
http://www.findinghim.com/...rtal_delete_all.html
http://www.findinghim.com/...tes/portal_home.html
http://www.findinghim.com/...es/portal_error.html
http://www.findinghim.com/...tes/portal_link.html
and in the forum...
PortalLinks 2.0 is located here:
http://www.camelsoup.com/source/portal.txt
http://www.camelsoup.com/source/portal_add.html
http://www.camelsoup.com/...e/portal_delete.html
http://www.camelsoup.com/...rtal_delete_all.html
http://www.camelsoup.com/...ce/portal_error.html
http://www.camelsoup.com/source/portal_form.html
http://www.camelsoup.com/source/portal_home.html
http://www.camelsoup.com/source/portal_link.html
http://www.camelsoup.com/...ce/portal_login.html
http://www.camelsoup.com/...e/portal_logoff.html
http://www.camelsoup.com/source/portal_reg.html
note: version 2.0 hasn't been updated yet, so there's a few template/tag issues. read the threads on 2.0 for the fix.
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 9, 2001, 4:02 AM
Veteran / Moderator (18436 posts)
May 9, 2001, 4:02 AM
Post #15 of 66
Views: 15408
Hi Drew. Are the links at http://www.camelsoup.com/ meant to work now? I was trying to view more info about the mods, but it just gives a 404 error
.
Andy
webmaster@ace-installer.com
http://www.ace-installer.com

Andy
webmaster@ace-installer.com
http://www.ace-installer.com
May 9, 2001, 11:28 AM
Veteran / Moderator (1936 posts)
May 9, 2001, 11:28 AM
Post #16 of 66
Views: 15368
For those of you who are still having difficulties accessing portal 1.0 and 2.0, they are now available through ftp...
ftp://ftp.camelsoup.com/pub/PortalLinks_1.0/ for PortalLinks 1.0
ftp://ftp.camelsoup.com/pub/PortalLinks_2.0/ for PortalLinks 2.0
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
ftp://ftp.camelsoup.com/pub/PortalLinks_1.0/ for PortalLinks 1.0
ftp://ftp.camelsoup.com/pub/PortalLinks_2.0/ for PortalLinks 2.0
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 10, 2001, 4:53 AM
Veteran / Moderator (18436 posts)
May 10, 2001, 4:53 AM
Post #17 of 66
Views: 15296
Hi Drew. Are you gonna fix http://www.camelsoup.com/?view=portal??? I'm really interested in this mod
Thanks
Andy
webmaster@ace-installer.com
http://www.ace-installer.com

Thanks
Andy
webmaster@ace-installer.com
http://www.ace-installer.com
May 10, 2001, 10:09 AM
Veteran / Moderator (1936 posts)
May 10, 2001, 10:09 AM
Post #18 of 66
Views: 15215
that's about my least priority... just use the ftp links above. installation instructions are in the readme.txt file.
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 11, 2001, 4:49 PM
Novice (11 posts)
May 11, 2001, 4:49 PM
Post #19 of 66
Views: 15299
i have a question regarding the portal mod. I want to use the "my favorites" list in my home page. When i look at portal_links.htm i see a <%Description%> tag to read the User links. My question is how can i use that tag in my home page....or what code do i need for using the tags within portal_links.htm , on my homepage.
regards alfred
regards
alfred
regards alfred
regards
alfred
May 12, 2001, 1:42 AM
Veteran / Moderator (1936 posts)
May 12, 2001, 1:42 AM
Post #20 of 66
Views: 15273
Do you mean a 'bookmark' sidebar on your main Links index page, rather than going to portal.cgi to view the links? If so, than it's quite simple...
off the top of my head...
add a parameter to the top of the script...
Then add this:
my $max = 5;
my @links = split /\|/, $old;
my (@display, $output);
open (LINKS, "$db_lib_path/data/links.db") or die $!;
while () {
chomp (my $record = $_);
foreach (@links) {
$record =~ /^$_\|/ or next;
my @values = split /\|/, $record;
push @display, [ @values ];
}
}
close (LINKS);
my $saved = $#display + 1;
my $links = '';
my $i = 0;
foreach (sort { ${$a}[$db_title] cmp ${$b}[$db_title] } @display) {
my %rec = &array_to_hash(0, @{$_});
$links .= &load_template ("bookmark_link.html", { %rec, %globals });
$i++;
last if ($i = $max);
}
print header();
print &load_template("bookmark_home.html", {
'saved' => $saved,
'links' => $links,
%globals
});
}That should display the first 5 saved links, alphabeticly. The code could be a little off because I've been reworking 1.0 a lot.
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
off the top of my head...
add a parameter to the top of the script...
Code:
if (param('ssi') { &ssi(); }Code:
sub ssi { my $max = 5;
my @links = split /\|/, $old;
my (@display, $output);
open (LINKS, "$db_lib_path/data/links.db") or die $!;
while () {
chomp (my $record = $_);
foreach (@links) {
$record =~ /^$_\|/ or next;
my @values = split /\|/, $record;
push @display, [ @values ];
}
}
close (LINKS);
my $saved = $#display + 1;
my $links = '';
my $i = 0;
foreach (sort { ${$a}[$db_title] cmp ${$b}[$db_title] } @display) {
my %rec = &array_to_hash(0, @{$_});
$links .= &load_template ("bookmark_link.html", { %rec, %globals });
$i++;
last if ($i = $max);
}
print header();
print &load_template("bookmark_home.html", {
'saved' => $saved,
'links' => $links,
%globals
});
}
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 12, 2001, 8:19 AM
User (105 posts)
May 12, 2001, 8:19 AM
Post #21 of 66
Views: 15245
Hi Drew.
How can you include this... when there are saved links, there will be a extra tag at the bottom to delete all saved links. Make it unavailable to be seen by somebody who has no saved links.
It is quite silly when i view my favorites and see no saved link and see the tag to delete all favorites (I included it)
Thanks
How can you include this... when there are saved links, there will be a extra tag at the bottom to delete all saved links. Make it unavailable to be seen by somebody who has no saved links.
It is quite silly when i view my favorites and see no saved link and see the tag to delete all favorites (I included it)
Thanks
May 12, 2001, 8:45 AM
Veteran / Moderator (1936 posts)
May 12, 2001, 8:45 AM
Post #22 of 66
Views: 15177
In your portal_home.html template, make sure you use this:
<%links%>
<a href="portal.cgi?action=delete&ID=all">Delete All</a>
<%endif%>--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Code:
<%if links%> <%links%>
<a href="portal.cgi?action=delete&ID=all">Delete All</a>
<%endif%>
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 12, 2001, 9:09 AM
Veteran / Moderator (1936 posts)
May 12, 2001, 9:09 AM
Post #24 of 66
Views: 15311
There is no tag for navigation. I'm not too creative when it comes to designing templates so I've left the templates with only the bare minimum. just copy your layout from other templates.
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 12, 2001, 10:17 AM
Veteran (17240 posts)
May 12, 2001, 10:17 AM
Post #27 of 66
Views: 10037
Simple matter of using appropriate HTML codes. I would suggest picking up HTML for Dummies or reviewing some online HTML tutorials.
Or for the lazy solution, you could use a WYSIWYG editor, like Front Page or Dreamweaver to customize the templates. Of course, bearing in mind that you need to preserve placement of the Links 2.0 tags:
EXAMPLE:
<%if links%>
<%links%>
<%endif%>
Regards,
Eliot Lee
Or for the lazy solution, you could use a WYSIWYG editor, like Front Page or Dreamweaver to customize the templates. Of course, bearing in mind that you need to preserve placement of the Links 2.0 tags:
EXAMPLE:
Code:
<%if links%>
<%links%>
<%endif%>
Regards,
Eliot Lee
May 12, 2001, 11:28 AM
Novice (5 posts)
May 12, 2001, 11:28 AM
Post #28 of 66
Views: 9941
Well the problem is that as far as I can see the
text doesn`t get called from the portal_link.html page
this is all there is on the page:<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><ul>
<li><font face="arial size="2"><a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>" target="_blank">
<%Title%>
</a></font>
<%if Description%>
<font face="arial size="2">
<%Description%>
</font>
<%endif%>
<font 2="2" size="1" face="Verdana, Arial, Helvetica, sans-serif">(Added:
<%Date%>
) <a href="<%db_cgi_url%>/rate.cgi?ID=<%ID%>">[Rate It]</a></font> <a href="<%db_cgi_url%>/portal.cgi?action=add&ID=<%ID%>"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">[Add
to favorites]</font></a> <a href="<%db_cgi_url%>/portal.cgi?action=delete&ID=<%ID%>"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">[Remove
favorites]</font></a> <a href="http://www.dkflight.dk/flightlink/cgi-bin/portal.cgi?action=login"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">[login]</font></a>
</ul></td>
</tr>
</table>
</body>
</html>
So I think it gets printed from the cgi file.
Am I wrong
Please adwise
Stone
text doesn`t get called from the portal_link.html page
this is all there is on the page:<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><ul>
<li><font face="arial size="2"><a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>" target="_blank">
<%Title%>
</a></font>
<%if Description%>
<font face="arial size="2">
<%Description%>
</font>
<%endif%>
<font 2="2" size="1" face="Verdana, Arial, Helvetica, sans-serif">(Added:
<%Date%>
) <a href="<%db_cgi_url%>/rate.cgi?ID=<%ID%>">[Rate It]</a></font> <a href="<%db_cgi_url%>/portal.cgi?action=add&ID=<%ID%>"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">[Add
to favorites]</font></a> <a href="<%db_cgi_url%>/portal.cgi?action=delete&ID=<%ID%>"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">[Remove
favorites]</font></a> <a href="http://www.dkflight.dk/flightlink/cgi-bin/portal.cgi?action=login"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">[login]</font></a>
</ul></td>
</tr>
</table>
</body>
</html>
So I think it gets printed from the cgi file.
Am I wrong
Please adwise
Stone
May 12, 2001, 11:46 AM
Veteran (17240 posts)
May 12, 2001, 11:46 AM
Post #29 of 66
Views: 9937
Drew and all,
You might want to consider not using jump.cgi link in the PORTAL Links, as this is a really easy chance for LINK OWNERS to "bookmark" or save their link and then continually click on it. Yes, there are codes in jump.cgi to reduce abusive "clicking" of links.
But I have found that linking jump.cgi is a really easy way for LINK OWNERS to put their links in the Cool pages.
Regards,
Eliot Lee
You might want to consider not using jump.cgi link in the PORTAL Links, as this is a really easy chance for LINK OWNERS to "bookmark" or save their link and then continually click on it. Yes, there are codes in jump.cgi to reduce abusive "clicking" of links.
But I have found that linking jump.cgi is a really easy way for LINK OWNERS to put their links in the Cool pages.
Regards,
Eliot Lee
May 12, 2001, 3:38 PM
Novice (11 posts)
May 12, 2001, 3:38 PM
Post #30 of 66
Views: 10032
Hi junco Yes thats what i wanted to do. Place the bookmarks om my main page.I read the script (as much as i understand)but if im not mistaking ( im using templates) all the variables are read from Site_html_templates.pl so if i wanna use the variables(tags) like <%user%> ect that are ment to work with portal links then i have to add them as a variable to site_html_templates.pl ... also the code you suplied has to be added some way into the site_html_template..
( im a beginner with perl) but am i right about this? Or can i use a other solution for calling a variable... from portal.cgi
regards alfred
regards
alfred
( im a beginner with perl) but am i right about this? Or can i use a other solution for calling a variable... from portal.cgi
regards alfred
regards
alfred
May 13, 2001, 12:39 AM
Veteran / Moderator (1936 posts)
May 13, 2001, 12:39 AM
Post #32 of 66
Views: 10098
Which version? The codes would be similar, but here's for 2.0 (untested).
Change:
elsif (param('action') eq 'delete') { &delete(); }
else { &home(); }To:
elsif (param('action') eq 'delete') { &delete(); }
elsif (param('action') eq 'send') { &send(); }
else { &home(); }Then add:
my ($data, @links);
open (FAV, "$db_lib_path/data/portal/$user{'ID'}.db") or die ("Could not open file $user{'ID'}. $!");
$data = <FAV>;
chomp $data;
close (FAV);
if ($data) {
my @saved = split /\|/, $data;
open (DB, "$db_lib_path/data/links.db") or die ("Could not open file links.db. $!");
while (<DB>) {
chomp(my $line = $_);
foreach my $id (@saved) {
/^$id\|/ or next;
my @rec = split /\|/, $line;
push @links, [ @rec ];
}
}
close (DB);
}
my $links;
if ($#links > -1) {
foreach (@links) {
my %rec = array_to_hash(0, @{$_});
$links .= &load_template('portal_link_mail.html', { %rec, %globals });
}
} else { $links .= 'You have not saved any favorites.'; }
my $msg = qq|
Hello, $user{'Login'}! Below is listing of all your saved links:
$links
To view your favorite links online, visit:
$db_cgi_url/portal.cgi
|;
require "$db_lib_path/Mailer.pm";
my $mailer = new Mailer ({
'smtp' => $db_smtp_server,
'sendmail' => $db_mail_path,
'from' => $db_admin_email,
'subject' => 'Your saved links',
'to' => $user{'Email'},
'msg' => $msg,
'log' => ''
}) or return;
$mailer->send or return;
print header();
print &load_template('portal_mail.html', { %globals, %user });
}Create a link template called 'portal_link_mail.html' to be used to the email. should be text-based.
Create a new template called 'portal_mail.html' to be used to confirm the email was sent.
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Change:
Code:
if (param('action') eq 'add') { &add(); } elsif (param('action') eq 'delete') { &delete(); }
else { &home(); }
Code:
if (param('action') eq 'add') { &add(); } elsif (param('action') eq 'delete') { &delete(); }
elsif (param('action') eq 'send') { &send(); }
else { &home(); }
Code:
sub send { my ($data, @links);
open (FAV, "$db_lib_path/data/portal/$user{'ID'}.db") or die ("Could not open file $user{'ID'}. $!");
$data = <FAV>;
chomp $data;
close (FAV);
if ($data) {
my @saved = split /\|/, $data;
open (DB, "$db_lib_path/data/links.db") or die ("Could not open file links.db. $!");
while (<DB>) {
chomp(my $line = $_);
foreach my $id (@saved) {
/^$id\|/ or next;
my @rec = split /\|/, $line;
push @links, [ @rec ];
}
}
close (DB);
}
my $links;
if ($#links > -1) {
foreach (@links) {
my %rec = array_to_hash(0, @{$_});
$links .= &load_template('portal_link_mail.html', { %rec, %globals });
}
} else { $links .= 'You have not saved any favorites.'; }
my $msg = qq|
Hello, $user{'Login'}! Below is listing of all your saved links:
$links
To view your favorite links online, visit:
$db_cgi_url/portal.cgi
|;
require "$db_lib_path/Mailer.pm";
my $mailer = new Mailer ({
'smtp' => $db_smtp_server,
'sendmail' => $db_mail_path,
'from' => $db_admin_email,
'subject' => 'Your saved links',
'to' => $user{'Email'},
'msg' => $msg,
'log' => ''
}) or return;
$mailer->send or return;
print header();
print &load_template('portal_mail.html', { %globals, %user });
}
Create a new template called 'portal_mail.html' to be used to confirm the email was sent.
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 13, 2001, 7:00 AM
User (105 posts)
May 13, 2001, 7:00 AM
Post #33 of 66
Views: 9965
You are very good! Can wait to try it out...
Meanwhile... i been surfing many sites using links and I found lots of people using a mod that subsitutes the ratings with images.
Where is it available? I found some rating breakdowns that is graph like images. The images I want to use is stars.
If u are telling me that I can use the stars images to replace the graph, then should I use ratings breakdown 1 or 2 found in glennu's homepage?
Many thanks!!!
Meanwhile... i been surfing many sites using links and I found lots of people using a mod that subsitutes the ratings with images.
Where is it available? I found some rating breakdowns that is graph like images. The images I want to use is stars.
If u are telling me that I can use the stars images to replace the graph, then should I use ratings breakdown 1 or 2 found in glennu's homepage?
Many thanks!!!
May 13, 2001, 8:32 AM
Veteran / Moderator (1203 posts)
May 13, 2001, 8:32 AM
Post #35 of 66
Views: 9914
'Where is it available? '
Search the forum there's atleast a couple of posts outlining instructions for this.
Glenn
Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
Search the forum there's atleast a couple of posts outlining instructions for this.
Glenn
Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
May 13, 2001, 9:18 PM
Veteran / Moderator (1936 posts)
May 13, 2001, 9:18 PM
Post #36 of 66
Views: 9784
over 80% of the code would be the same, but you need to use a form to get the user's email address and have a hidden field called 'action' with a value of 'send'.
I suggest you go ahead and use the test version of 1.0 since it's almost the 'exact' same code as 2.0, and it's easier for me to make changes and adapt it quicker for both versions.
my ($email, @links, $links, $msg, $mailer);
$email = param('email');
$email =~ /^.+\@.+\..+$/ or &error('invalid looking email address');
if ($old) {
my @saved = split /\|/, $old;
open (DB, "$db_lib_path/data/links.db") or &error("Could not open file links.db. $!");
while (<DB>) {
chomp(my $line = $_);
foreach my $id (@saved) {
$line =~ /^$id\|/ or next;
my @rec = split /\|/, $line;
push @links, [ @rec ];
}
}
close (DB);
}
if ($#links > -1) {
foreach (@links) {
my %rec = array_to_hash(0, @{$_});
$links .= &load_template('portal_link_mail.html', { %rec, %globals });
}
} else { $links .= 'You have not saved any favorites.'; }
$msg = qq|Below is listing of all your saved links:\n|;
$msg .= qq|\n$links\n|;
$msg .= qq|To view your favorite links online, visit:\n|;
$msg .= qq|$db_cgi_url/portal.cgi|;
require "$db_lib_path/Mailer.pm";
$mailer = new Mailer ({
'smtp' => $db_smtp_server,
'sendmail' => $db_mail_path,
'from' => $db_admin_email,
'subject' => 'Your saved links',
'to' => $email,
'msg' => $msg,
'log' => ''
}) or return;
$mailer->send or return;
print header();
print &load_template('portal_mail.html', { %globals });
}Note, I've updated the other post as well, because I noticed a few syntax errors.
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
I suggest you go ahead and use the test version of 1.0 since it's almost the 'exact' same code as 2.0, and it's easier for me to make changes and adapt it quicker for both versions.
Code:
sub send { my ($email, @links, $links, $msg, $mailer);
$email = param('email');
$email =~ /^.+\@.+\..+$/ or &error('invalid looking email address');
if ($old) {
my @saved = split /\|/, $old;
open (DB, "$db_lib_path/data/links.db") or &error("Could not open file links.db. $!");
while (<DB>) {
chomp(my $line = $_);
foreach my $id (@saved) {
$line =~ /^$id\|/ or next;
my @rec = split /\|/, $line;
push @links, [ @rec ];
}
}
close (DB);
}
if ($#links > -1) {
foreach (@links) {
my %rec = array_to_hash(0, @{$_});
$links .= &load_template('portal_link_mail.html', { %rec, %globals });
}
} else { $links .= 'You have not saved any favorites.'; }
$msg = qq|Below is listing of all your saved links:\n|;
$msg .= qq|\n$links\n|;
$msg .= qq|To view your favorite links online, visit:\n|;
$msg .= qq|$db_cgi_url/portal.cgi|;
require "$db_lib_path/Mailer.pm";
$mailer = new Mailer ({
'smtp' => $db_smtp_server,
'sendmail' => $db_mail_path,
'from' => $db_admin_email,
'subject' => 'Your saved links',
'to' => $email,
'msg' => $msg,
'log' => ''
}) or return;
$mailer->send or return;
print header();
print &load_template('portal_mail.html', { %globals });
}
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 18, 2001, 10:04 AM
User (105 posts)
May 18, 2001, 10:04 AM
Post #37 of 66
Views: 9694
[reference to the above code, for portal v1.0]
Couldn't run ur code at first but after noticing some mistakes...
left out>>> my $in = shift;
inserted>>> $email = $in->param('email');
inserted>>> print $in->header();
the cgi files managed to be executed but the email dat was send to me says... "You have not saved and favorites"...
I think it could be something to do wif this part
pls help and thanks in advance...
Couldn't run ur code at first but after noticing some mistakes...
left out>>> my $in = shift;
inserted>>> $email = $in->param('email');
inserted>>> print $in->header();
the cgi files managed to be executed but the email dat was send to me says... "You have not saved and favorites"...
I think it could be something to do wif this part
pls help and thanks in advance...
May 18, 2001, 11:14 AM
Veteran / Moderator (1936 posts)
May 18, 2001, 11:14 AM
Post #38 of 66
Views: 9770
Didn't I say to use the test version of 1.0?
To use this with the original 1.0, yes you need to have that OO crap in since that's the way it was written. Aditionally, you'll need to add this:
and change this:
To:
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
To use this with the original 1.0, yes you need to have that OO crap in since that's the way it was written. Aditionally, you'll need to add this:
Code:
my $old = cookie($name);Code:
my @saved = split /\|/, $old;Code:
my @saved = split /x/, $old;Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 18, 2001, 2:39 PM
Novice (11 posts)
May 18, 2001, 2:39 PM
Post #39 of 66
Views: 9751
hi junco
i already asked you the bookmark sidebar question. But
a few questions more here
Where do i put the code you gave?
I already tryed it in portal.cgi and in site_html_templates.pl but that doesn't work...
And if i put the code inside a file ??? What would be the tag(s) to put in the main index(the template home.html)
The portal mod is working fine the way it was ment by the way.
Regards
alfred
regards
alfred
i already asked you the bookmark sidebar question. But
a few questions more here
Where do i put the code you gave?
I already tryed it in portal.cgi and in site_html_templates.pl but that doesn't work...
And if i put the code inside a file ??? What would be the tag(s) to put in the main index(the template home.html)
The portal mod is working fine the way it was ment by the way.
Regards
alfred
regards
alfred
May 18, 2001, 11:40 PM
User (105 posts)
May 18, 2001, 11:40 PM
Post #40 of 66
Views: 9665
Hi junko! I did wat u said and it worked! Thanks!!! U are brillant...
I stumbled on something, on the page that says your email has been sent, if i keep refreshing the page... and clicked on 'retry' for the prompt... the email will be sent to the address another time. Is there any way to prevent the email from being send again?
Thanks...

I stumbled on something, on the page that says your email has been sent, if i keep refreshing the page... and clicked on 'retry' for the prompt... the email will be sent to the address another time. Is there any way to prevent the email from being send again?
Thanks...
May 18, 2001, 11:58 PM
Veteran / Moderator (1936 posts)
May 18, 2001, 11:58 PM
Post #41 of 66
Views: 9690
You could save a timestamp to a cookie called 'time' using time(). On each load the page, get the cookie with cookie('time'), and subtract value from the current time and see if it's less than the number of seconds in a day, and redirect to an error page if it is.
(or you could do the same thing as a database... but this is a bit quicker to code)
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
(or you could do the same thing as a database... but this is a bit quicker to code)
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 22, 2001, 8:22 AM
Veteran / Moderator (1936 posts)
May 22, 2001, 8:22 AM
Post #44 of 66
Views: 9675
You changed something you shouldn't have...
If you look in the code I provided there is no print statement before &error...
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Code:
($email =~ /^.+\@.+\..+$/) or print &error("Invalid looking email address");--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 22, 2001, 11:01 PM
User (105 posts)
May 22, 2001, 11:01 PM
Post #45 of 66
Views: 9753
sorrie never see it is w/o the 'print'
but still... doesn''t work.
when i never type any address and click submit - it brings to internal server error
when i type a fake address, without @ and submit, it brings me to success page.
I will get an email when i entered a proper address.
*confused*
but still... doesn''t work.
when i never type any address and click submit - it brings to internal server error
when i type a fake address, without @ and submit, it brings me to success page.
I will get an email when i entered a proper address.
*confused*
May 23, 2001, 7:04 AM
Veteran / Moderator (1936 posts)
May 23, 2001, 7:04 AM
Post #46 of 66
Views: 9582
Make sure you have this subroutine:
my $message = shift;
print header();
print &load_template ('portal_error.html', {
'message' => $message,
%globals
});
exit;
}and make sure you have a template called 'portal_error.html' with the 'message' tag in it.
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Code:
sub error { my $message = shift;
print header();
print &load_template ('portal_error.html', {
'message' => $message,
%globals
});
exit;
}
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 23, 2001, 10:39 AM
User (105 posts)
May 23, 2001, 10:39 AM
Post #47 of 66
Views: 9576
Hmmm i got an error at line 246
the print header() part
pls help me seee my script... http://www.lazyjuice.com/downloads/portal.txt
thanks...
the print header() part
pls help me seee my script... http://www.lazyjuice.com/downloads/portal.txt
thanks...
May 23, 2001, 1:46 PM
Veteran (19537 posts)
May 23, 2001, 1:46 PM
Post #48 of 66
Views: 9487
Try changing this:
my $message = shift;
print header();
print &load_template ('fav_error.html', {
'message' => $message,
%globals
});
exit;
}
....to....
my $message = shift;
print $in->header();
print &load_template ('fav_error.html', {
'message' => $message,
%globals
});
exit;
}Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/
Code:
sub error { my $message = shift;
print header();
print &load_template ('fav_error.html', {
'message' => $message,
%globals
});
exit;
}
....to....
Code:
sub error { my $message = shift;
print $in->header();
print &load_template ('fav_error.html', {
'message' => $message,
%globals
});
exit;
}
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/
May 23, 2001, 1:55 PM
Veteran / Moderator (1936 posts)
May 23, 2001, 1:55 PM
Post #49 of 66
Views: 9734
I really wish you upgraded to one other 3 newer versions... any of them:
PortalLinks 1.0 (cookies)
version: 2.0 posted 13-May-01
PortalLinks 2.0 (flatfile)
version: 1.01 posted 01-May-01
PortalLinks 3.0 (mySQL)
version: 1.0 posted 18-May-01
Now.. if you insist on using old code, couple things you need to fix:
1) you did not completely comment out the old subroutine
2) change
print header();to:
print $in->header();3) change any instance like:
print $in->header();
print &error;or
to something like:
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
PortalLinks 1.0 (cookies)
version: 2.0 posted 13-May-01
PortalLinks 2.0 (flatfile)
version: 1.01 posted 01-May-01
PortalLinks 3.0 (mySQL)
version: 1.0 posted 18-May-01
Now.. if you insist on using old code, couple things you need to fix:
1) you did not completely comment out the old subroutine
2) change
Code:
my ($message) = shift; print header();
Code:
my ($message, $in) = @_; print $in->header();
Code:
$message = "error message"; print $in->header();
print &error;
Code:
&error("error message");Code:
&error("error message.", $in);Free, hot camel soup for Links hackers...
http://www.camelsoup.com
May 25, 2001, 9:19 AM
Veteran / Moderator (1936 posts)
May 25, 2001, 9:19 AM
Post #52 of 66
Views: 6999
version 2.0 cookie does not have the registed users function but does have page spanning (the file is named portal_2.01.txt). The only posible problem is that your users cookie may become corrupt after upgrading. To prevent that, look for codes like this in your old copy:
or
and make sure that in the new script you are using the same thing (the bolding code from above) to split and join on.
Further instructions are in the readme file (readme_2.01.txt).
I just had an idea for upgrading cookie to flatfile...
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Code:
split /x/Code:
join /x/Further instructions are in the readme file (readme_2.01.txt).
I just had an idea for upgrading cookie to flatfile...
--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Jan 24, 2002, 1:08 PM
Veteran / Moderator (1936 posts)
Jan 24, 2002, 1:08 PM
Post #55 of 66
Views: 6731
Jan 26, 2002, 8:53 AM
Veteran / Moderator (1936 posts)
Jan 26, 2002, 8:53 AM
Post #58 of 66
Views: 6758
Aug 24, 2003, 8:44 PM
Veteran / Moderator (1936 posts)
Aug 24, 2003, 8:44 PM
Post #60 of 66
Views: 6758
Aug 27, 2003, 4:59 AM
User (124 posts)
Aug 27, 2003, 4:59 AM
Post #64 of 66
Views: 6588
Your mod seems to work very fine, than you very much.
i tried something but unsuccessfully
:
i use 2 separate 'links2' scripts in my site : 'links' (cgi-bin/links/admin/..) and 'postcards' (cgi-bin/postcards/admin/..).
then, i installed 'portal' mod in my 2 separated 'links' and 'postcards' scripts.
it would be fine if the users of 'my favorite postcards' are automatically subscribed to 'my favorite links', or vice-versa.
i tried to add simultanously the user.db file in 'cgi-bin/links/admin/data/portal/' and 'cgi-bin/postcards/admin/data/portal/' folders when i subscribe in any of the 'portal' form.
might be easy to do, but i don t know anything about programing.
Tanx if you know. Cheers. J.

i tried something but unsuccessfully

i use 2 separate 'links2' scripts in my site : 'links' (cgi-bin/links/admin/..) and 'postcards' (cgi-bin/postcards/admin/..).
then, i installed 'portal' mod in my 2 separated 'links' and 'postcards' scripts.
it would be fine if the users of 'my favorite postcards' are automatically subscribed to 'my favorite links', or vice-versa.
i tried to add simultanously the user.db file in 'cgi-bin/links/admin/data/portal/' and 'cgi-bin/postcards/admin/data/portal/' folders when i subscribe in any of the 'portal' form.
might be easy to do, but i don t know anything about programing.
Tanx if you know. Cheers. J.
Aug 27, 2003, 11:59 PM
Enthusiast (854 posts)
Aug 27, 2003, 11:59 PM
Post #65 of 66
Views: 6568
shouldn't be hard at all. Use a single users.db file. Edit portal.cgi so that whereever you have:
it points to the file you want to use. If you want a single users.db and single user links file for both it'd be much more work than it's worth.
Philip
------------------
Limecat is not pleased.
Code:
open (USER, "$db_lib_path/data/portal/users.db") or die ("File-Error 'users.db'. $!");Philip
------------------
Limecat is not pleased.
Sep 23, 2003, 3:15 AM
User (124 posts)
Sep 23, 2003, 3:15 AM
Post #66 of 66
Views: 6535
your script works very fine, tank you very much !!! 

i don t understand about 'send mail'. is there a link 'send my links by mail' that the visitor must click ? or does it send automatically ? actually i don t receive anything. i use the version 2.0
and i don t understand neither what should be written in 'portal_link_mail.html'.
tanx if you can answer.



i don t understand about 'send mail'. is there a link 'send my links by mail' that the visitor must click ? or does it send automatically ? actually i don t receive anything. i use the version 2.0
and i don t understand neither what should be written in 'portal_link_mail.html'.
tanx if you can answer.