Gossamer Forum
Home : Products : Links 2.0 : Customization :

MY LINKS

(Page 1 of 4)
> >
Quote Reply
MY LINKS
If you Perl gurus feel this mod is working well enough, please, will you develop some step by step instructions and post them somewhere. This could be one of the most important mods ever created for Links. I know I would very much like to use it.

Thanks,

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: MY LINKS In reply to
i know that the javascript and the perl of the current code works.. however.. i will rescript it into 100% perl for the heck of it tonight (we have a 2 day vacation).. right now i have to go to the library and pull up some value lines for some stocks i bought..

ticker symbols (CMGI EXDS NTAP AOL NTAP) yes.. high returns.. Smile

jerry
Quote Reply
Re: MY LINKS In reply to
There's no great hurry. I just thought you had forgotten about it, but i sure will appreciate it.

Good luck with the stocks, you tycoon.

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: MY LINKS In reply to
Jerry
I've already done that and I only have one little snag to fix before I can make it available. here's my post concerning my problem.

Quote:
Hey, I'm near the end of a really nice MyLinks mod which was obviouslly inspired by this thread. It works 100% (as far as I know) during one browser session, but close the browser and return and your cookie is lost. I'm using Matt's cookie.lib and I've set the experation date in the file.
$Cookie_Exp_Date = 'Mon, 01-Jan-2001 12:00:00 GMT';

but it still doesn't hold. Like i said it store the cookies fine as long as you don't close the browser. Lil help anyone?

http://bartour.hypermart.net/links2/pages/index.html

you can check it out here. goto any detailed page a click "Add to My BarTour" add a couple and the you can view the listing from the popup, modify your links from the popup, clicking a link in the popup opens the detailed page for that link in the main window. or click "My BarTour" at the top of any Links page and see the listing of your saved links.

I've spent as much time trying to fix this damn cookie eperation as I did writing the whole script. I also screwed up my local cookies making it so I'm not sure if this is my problem or a script problem.

Any input would be great.

Widgets and Eliot - I couldn't get your script to work but in the process of trying I came up with this. Thanx!

I've also tried setting the cookie experation in the script itself but had the same problem.

If anybody knows cookies and can point me in the right direction, I'd be able to make this available for everyone.

Try it out and tell me what you think
Mutt

------------------
http://bartour.hypermart.net
Quote Reply
Re: MY LINKS In reply to
widgetz, not bad choices. i got in on kide when it was 32.
Quote Reply
Re: MY LINKS In reply to
ok.. it works.. there are just a bunch of templates that need to be added..

site_html_my_add
site_html_my_add_error
site_html_my_delete
site_html_my_delete_error
site_html_my_link
site_html_my_home

the script originally was using "strict" but because strict is TOTALLY uncompatible with links 2.0.. i had to take it off.. there are still a bunch of variables that are localized and globalized though..

jerry
Quote Reply
Re: MY LINKS In reply to
mutt..

the problem isn't the expiration date.. it's the way your setting cookies..

i haven't made the script yet.. cause when i got home all i did was eat and then sleep.. i couldn't stay awake..

anyways.. i'll do it now.. i'm gonna make it the way you guys want it (cookies) then i'm gonna make it for Links SQL.. (db) so the data is saved forever.. not expiring in a certain period of time..

jerry
Quote Reply
Re: MY LINKS In reply to
ok.. i'm done with the perl.. i'm gonna test it with someones Links 2.0 though.. cause i don't have links 2.0 installed anywhere anymore..

jerry
Quote Reply
Re: MY LINKS In reply to
where did you post the code? i do not see it anywhere on your site. or are you still working on it?
Quote Reply
Re: MY LINKS In reply to
test it out first..

http://www.hexapods.com/...in/links/mylinks.cgi

to add..

ADD ?add=####

behind the URL.. some small numbers don't exist.. like #1, #2, and some more.. so add big 3 digit numbers.. or add 1000+ numbers.. there are actually over 7000 links..

then go back to the main mylinks.cgi and you will see the links displayed.. also.. you can test closing the browser completely and then going to see that it's still there..

i know.. the templates are SOO plain Smile they took me a WHOLE minute.. to do all.. umm 7

jerry
Quote Reply
Re: MY LINKS In reply to
Good work JERRY Wink i'm looking foward to get this script Smile
Rimvis
Quote Reply
Re: MY LINKS In reply to
it seems to be working fine. i closed the browser and cleared the cache and went back and the links i added still there.
does the links expire after a certain number of days? is it possible to use a differnt computer and see the same links i added?
like assigning an id to the page where i can access it using any computer from any location.
Quote Reply
Re: MY LINKS In reply to
looks great. Mine works now, but since yours will be using templetes, It will be easier for people to modify.
Quote Reply
Re: MY LINKS In reply to
This looks pretty cool, could server a purpose for my site.
Quote Reply
Re: MY LINKS In reply to
theguy.. no you can't do that.. that's why cookies suck Smile

the Links SQL one i made uses the user database to save the data.. so it doesn't use cookies.. that way the data can be used anywhere..

ok.. this version doesn't require much.. it only requires CGI.pm and CGI/Carp.pm.. if you don't have CGI/Carp.pm you can just take a line out and it will be ok.. but you have to have CGI.pm.. if you don't have CGI.pm then you have to use a cookie library like Matt's cookie.lib.. or the one i wrote (in the other thread)..

also.. you can set how many days you want the cookie to expire.. for the demo.. i set the cookie to expire in 3 years from the time set.. it's dynamic because with CGI.pm you don't have to set the exact date.. you can say

'+1y +3m +15d +6s'

to expire in 1 year, 3 months, 15 days, and 6 seconds..

here is just a skim through of the instructions..

ADD

Code:
sub site_html_my_link {
my %rec = @_;

($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});

return &load_template ('my_link.html', {
%rec,
%globals
});
}

sub site_html_my_home {
my $tags = shift;
print &load_template ('my_home.html', {
%$tags,
%globals
});
}

sub site_html_my_add {
my %rec = @_;
print &load_template ('my_add.html', {
%rec,
%globals
});
}

sub site_html_my_add_error {
my $message = shift;
print &load_template ('my_add_error.html', {
message => $message,
%globals
});
}

sub site_html_my_delete {
my %rec = @_;
print &load_template ('my_delete.html', {
%rec,
%globals
});
}

sub site_html_my_delete_all {
my $tags = shift;
print &load_template ('my_delete_all.html', {
%$tags,
%globals
});
}

sub site_html_my_delete_error {
my $message = shift;
print &load_template ('my_delete_error.html', {
message => $message,
%globals
});
}

to site_html_templates.pl (if you don't use site_html.pl.. you'll have to figure it out yourself.. it's actually not that hard.. if you don't know how to do it.. email me (jsu7785@email.com)..

then you need like 7 templates... i think you guys should be able to figure these out yourselves.. first..

my_link.html
(very similiar to link.html.. except you add something like

Code:
<a href="mylinks.cgi?delete=<%ID%>">delete</a

my_home.html
(main thing to this is <%total%> and <%link_results%> .. you guys might want span pages.. if so.. tell me and i'll implement it.. (i might as well.. so i'll do it after i post this message)..

my_add.html
(you can put any link tags here..)

my_add_error.html
(the only tag other than globals is <%message%>.. which contains the error message..)

my_delete.html
(you can put any link tags here..)

my_delete_all.html
(you can put <%total%> here to tell them how many links there were that they deleted)

my_delete_error.html
(the only tag other than globals is <%message%>.. which contains the error message..)

and finally.. mylinks.cgi..

http://www.widgetz.com/mylinks.txt

jerry
Quote Reply
Re: MY LINKS In reply to
ok.. i added span pages.. the thing you guys need to know is <%span%> in my_home.html

and to put it insde something like this

Code:
<%if link_results%>
<%if span%>
<p><%span%></p>
<%endif%>
<%link_results%>
<%endif%>
<%ifnot link_results%>
No Links!
<%endif%>

that way you don't get a unknown tag: span or unknown tag: link_results..

that's all..

jerry
Quote Reply
Re: MY LINKS In reply to
also.. there are a few variables to define..

Code:
# Links to display per page.
my $per_page = 10;

# Cookie information.
my %cookie = (
name => 'MyLinks',
expires => '+3y',
path => '/',
domain => '.widgetz.com'
);

they are all self explainatory.. you can leave them all alone except for domain in %cookie.. change it to you domain.. it requires 2 periods.. if you have a subdomain.. like something.hypermart.net.. put .hypermart.net if you put .something.hypermart.net it won't work..

jerry
Quote Reply
Re: MY LINKS In reply to
i just changed the code again.. you now use <%links%> instead of <%link_results%> .. did that for the heck of it Wink

and then the biggest change is when i added 50 ids.. i noticed how big the cookie got.. so now i allow you to choose your deliminator.. i suggest you choose a letter.. cause it takes the smallest space.. (1 byte).. a symbol takes 3 and a number will screw your whole cookie up Smile

when you download it.. it will have A as the deliminator.. just change it to whatever.. if you want.. make it like a lowercase l so it looks like a pipe Smile

or a lowercase o so it looks like a big period.. or x is good too...

also.. keep in mind you should NEVER change your delimeter after you choose it.. all your cookies will be messed if you do..

jerry

[This message has been edited by widgetz (edited November 26, 1999).]
Quote Reply
Re: MY LINKS In reply to
i just found a bug that only appears if you have 3 pages of links... if you downloaded it before this time.. just find

$prev_page

and change it to

$prev

(that's why strict is so useful)

jerry
Quote Reply
Re: MY LINKS In reply to
That's OK. I'm waiting to see it here http://www.widgetz.com/links_mods/ in step by step. I've got too much invested to screw it up know.

Jerry, you're such a talented programmer. When you finally hit college, you're going to be able to teach the instructors a thing or two and I bet you make a gazillion dollors with your skills.



------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: MY LINKS In reply to
I have it looking good, one question, how did you get the add random links, did you just say rand in perl and made it not go over how many links he has?

[This message has been edited by Bmxer (edited November 26, 1999).]
Quote Reply
Re: MY LINKS In reply to
Are the cookies stored on our servers or are they served on the users' PC?
Quote Reply
Re: MY LINKS In reply to
cookies are stored on users PCs...

bmxer.. it's almost the same thing as how it works with jump.cgi Smile

also.. could you give me your URL?

i'm in the need of nice templates before i release the instructions..

ALSO.. i killed two birds with one stone Wink.. my next lab for my perl college course has to do with cookies Wink something similiar to this.. except the data comes from somewhere else.. i also have to come up with an encrypt/decrypt algorithm to make the size of the cookie smaller.. Wink

jerry

[This message has been edited by widgetz (edited November 26, 1999).]
Quote Reply
Re: MY LINKS In reply to
code changed.. again..

just to get rid of that stupid looking span

< Previous 1 Next >

when there are no links Wink

jerry
Quote Reply
Re: MY LINKS In reply to
  http://lookhard.hypermart.net
Thats cool, that your taking college courses.

[This message has been edited by Bmxer (edited November 26, 1999).]
> >