Gossamer Forum
Home : Products : Links 2.0 : Customization :

"SEMI"-COOKIE "MyLinks" Mod

(Page 3 of 3)
> >
Quote Reply
Re: NON-COOKIE "MyLinks" Mod In reply to
I'm having a bit of time trying to follow that block of code... your formatting is awful Tongue How about indenting blocks of code with a couple spaces or a tab instead?

You may want to:
-make sure the page number passed in is valid
-chomp() @data as it's being read in, then use $#data + 1 to get the number of saved links instead of that nasty foreach loop
-make the number of links per page a variable
-make the current page non-linked in the page span section.

This doesn't make a whole lot of sense:
Code:
while ($count++ < 5) {
next if ($data[$count] !~ /\d+/);
because when will $count not be a series of digits? But if it isn't, the count is still incremented and you will NOT get 5 links on the page.

I hope you find this as positive constructive critizicism and nothing else.

--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Quote Reply
Re: NON-COOKIE "MyLinks" Mod In reply to
Yeah no problem - that's why I posted it. I've never "done" spanning before and to be honest I found it pretty tough but once it looked like it was working ok then I stopped and didn't want to touch it incase it stopped working .....hehe Smile

I am going to go over it again to neaten it up and take into acount what you said.

Cheers.

I also think it was misleading because I haven't shown all the code. I do check if the page number passed in is valid or not and perform other checks too but I didn't paste that because it is in sub main..

Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

Quote Reply
Re: NON-COOKIE "MyLinks" Mod In reply to
I tackled page spanning in a nearly completely different way. I won't post the code because it's downloadable from my site (versions 1.2 and 2.1 and 3.1).

I'd really like a look at the whole script or do I have to wait like everyone else? Crazy

--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Quote Reply
Re: NON-COOKIE "MyLinks" Mod In reply to
I'm scared to show you now......hehe.......it is pretty cumbersome at the moment.

Each sub uses stuff like:

%ck = fetch CGI::Cookie;

($name,$value) = split(/=/, $ck{CWTRACKER});
($u,$p) = split(/--/, $value);

...amongst other things, so what I still need to do is make one sub with all that stuff in it and then call the sub and return the variables rather than repeating the same code over an over.

Let me neaten it slightly and I'll give you access to it.

Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

Quote Reply
Re: NON-COOKIE "MyLinks" Mod In reply to
Couldn't you just use:
Code:
my ($u,$p) = split (/--/, $IN->cookie('CWTRACKER'));
instead of that whole CGI::Cookie thing...?

--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Quote Reply
Re: NON-COOKIE "MyLinks" Mod In reply to
Does $IN->cookie automatically split it at = ?

Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

> >