Gossamer Forum
Home : Products : Links 2.0 : Customization :

MY LINKS II: (Cont'd)

(Page 1 of 3)
> >
Quote Reply
MY LINKS II: (Cont'd)
I was getting tired of waiting for the following Thread to download:

www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/004046.html

This Thread is for discussing the mylinks.cgi script, which allows web visitors of your LINKS site to store their own links via the cookie.file.

Widgetz,

The new version of the script looks great. Are you willing to share it with us???

Thanks.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited November 29, 1999).]
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
this is actually the THIRD thread..

oh.. no.. that version running right now uses hexadecimal values which sometimes doesn't make a difference.. i have come up with MY OWN system that will save space starting from a two digit number..

it can save 1 byte for 10-999 and two bytes from 1000-1250 and the until like 4000 it can start saving big time.. like 3 bytes in the millions Wink

i'm still working on decoding though..

jerry
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
all i can say. it's really messed up right now.. i can't figure out the "EQUATION" to decode the encoded code.. Smile

well in perl at least.. the instructor told me it would probably challenge me cause i haven't been through a high enough math level or something Wink

anyways.. if you add a link.. it saves it correctly.. but the page displays the wrong link cause it decodes it wrong..

jerry
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
I WENT THROUGH 2 HOURS OF WONDERING WHAT I WAS DOING WRONG AND THE WHOLE TIME IT WASN'T CAUSE OF MATH!!

it was cause i used substr wrong..

i had thought that it was

substr ($variable, offset, finish)

so i had been putting $i+1 in finish which kept making the value 0..

anyways.. i don't want to talk about it Wink

hypermart's ftp is down right now.. so you have to get it here:

ftp://ftp.pdamania.com/

it's obviously mylinks.txt

OK.. here are the RESTRICTIONS..

set %cookie yourself..

the DELIMINATOR MUST BE A LETTER.. not a number.. and it MUST BE lowercased..

just remember that.. and you will survive

also.. leave @e alone.. only change that if you know what it does..

if you want.. you can put ALL the characters except for your deliminator and symbols.. then the cookie will be even smaller.. if you have over 1000 links it will be more noticeable..

jerry
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Use my templates if you like.

To get the Add My Link, all you have to do is add the following codes in your link.html file:

Code:
<a href="http://www.mydomain.com/cgi-bin/mylinks.cgi?add=<%ID%>">Add My Links</a>

This is shown in my template files.

Good luck.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
the first script did not work for me. i think some modules are not installed on my server.

jerry,
you mentioned that you have a script which checks all the modules on the server.
where can i get this script?
thanks

it looks like i need to move to a new server.
any sugesstion?
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Here's the code for modules.cgi
modules.cgi?LWP is an example of a querry


#!/usr/bin/perl
use strict;
use File::Find;
my (@mod, %done, $dir);
find(\&get, grep { -r and -d } @INC);
@mod = grep(!$done{$_}++, @mod);
foreach $dir (sort { length $b <=> length $a } @INC) {
foreach (@mod) { next if s,^\Q$dir,,; }
}
print "Content-type: text/html\n\n";
foreach (@mod) { s,^/(.*)\.pm$,$1,; s,/,::,g; print "$_<br>\n"; }
print "Done! ($#mod modules!)\n\n";
sub get { /^.*\.pm$/ && /$ARGV[0]/i && push @mod, $File::Find::name; }


Shane

Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
the good news: the modules are installed on my server.

the bad news: i spent over 6 hours trying to get this thing working with no luck.

i think we need detailed insruction on how to install this mode
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Widgetz,

The mod works great. You da man!
I was wondering if the following two additions would be possible:

1. I want the category of each link in My Links to be shown as well. That's easy enough. But the trick would be to sort all the links in My Links so that if there are more than one from the same category, they would be all grouped together under the category name, not scattered all over the place.

2. It would be great to let the user add a brief comment to each link as a reminder of why it was worth saving. I know with my memory I could definitely use something like that Smile

Thanks for great mod(s).

andrew
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Jerry Great Job!!
finally i got it to work (version1)
what's the difference between the first one and the second one? all i need to do is upload the new mylink.cgi?

is it possible to add ouside links?
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Looks like we're almost there. Couple of questions. 1. Will Elliot's templates work OK with this script? 2. How do we get "Add To My Links" to display after each link?

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Thanks Elliot, for the templates. Now I'm getting the error
Quote:
Software error:
Undefined subroutine &main::site_html_my_add called at /home/httpd/virtual-domains/fishhoo/cgi-bin/links/mylinks.cgi line 112.

I suppose this means I need to change the template names to site_html_blah, blah.html. Correct?

Please pardon a dummy!

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
i got the same error last night:

solution Smile

My_templates should be in the same directory as links templates
mylinks.cgi should be in the same directory as add.cgi, search.cgi

good luck!
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Nope, I'm missing something. What else needs to be done?

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Well, it works great in IE, but for some reason the cookie doesn't get set at all in Netscape. Any ideas?

TIA,

Andrew
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
I found my problem while looking through these looong threads. I forgot to add the code to site_html_templates.pl . When I try to copy & paste it into a text editor, it paste as one long line and I have tried 3 different editors. Can someone e-mail me that section of the code? Please?
willdeb@adelphia.net

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
the difference between this and the original version is that this one can store TWICE as many links and the cookie is somewhat encrypted (not really.. but when i figure out what to do for my lab.. i'll put it in mylinks.cgi)

anyways.. if you want.. you can change the @e variable and totally MIX it up so people won't understand it..

if you change $deliminator to 'A';

you can use @e as

9 J H f h 7 L m M T u U v Z x X P e E q l 2 4 and just keep going with uniqe characters.. ALL EXCEPT capital A.. and no symbols.. you'll get a totally new encrypt.. but oh well.. only do it if you know what you're doing..

Andrew..

make sure you are using the .cgi script with

at least two periods in the domain name.. for instance.. if you ran it like this

http://something.com/mylinks.cgi?add=333

it wouldn't work..

if you ran it like this:

http://www.something.com/mylinks.cgi?add=333

it would work.. it's required for Netscape for it to have two domains.. also make sure you set %cookie's domain with two periods also..

jerry
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Widgetz,

The new script works great! Thank you.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
also.. andrew..

1. that canbe done by using a few loops in sub display..

try this..

Code:
my (%links, %cat, %rec);
foreach (@c) {
last if ($_ eq "");
%rec = &get_record ($_);
%{$links{$_}} = %rec;
push (@{$cat{$rec{Category}}}, $_);
}

CAT: foreach (sort keys %cat) {
$OUT{links} .= qq~<p>$_<br>~;
LINK: foreach (@{$cat{$_}}) {
$OUT{links} .= &site_html_my_link (%{$links{$_}});
}
}

it's pretty basic.. but to make it look better you might want to add like &build_linked_title from nph-build.cgi into the script..

the second thing is not smart with a cookie..

i'm pretty much done with the Links SQL version..

i'm not sure if i'm willing enough to make the UBB version.. maybe someone else will

jerry
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Thanks Jerry,

Once again you saved the day Smile

andrew
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
btw.. andrew.. that doesn't work with span pages.. Smile

jerry
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Attn: Elliot - Small question?

Exactly where and how did you define <%SiteURL%>. You call it in my_delete.html. When I tried to delete a link, that was shown as undefined do I had to cut it out of the template to make it work at all. That seems to be the only snag left. Other than that everything seems to be working great. Guess I got impatient waiting for the detailed instructions. Patience never has been one of my strong suits.

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
Well, all you have to do is change <%LinkURL%> (NOT SiteURL) to <%URL%>.

That should've been easy to fix on your own.

Wink

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
it must be a mistake.

try:

<%URL%> in it's place and it should work

thanks eliot Smile
i wrote it before eating dinner Smile

[This message has been edited by theguy (edited December 02, 1999).]
Quote Reply
Re: MY LINKS II: (Cont'd) In reply to
i believe eliot has many different URL fields.. thats why it's called SiteURL

jerry
> >