Gossamer Forum
Home : Products : Links 2.0 : Customization :

Yet another MyLinks question

Quote Reply
Yet another MyLinks question
... the absolutely only thing I wasn't able to figure out yet is what is the variable to use if the reason for an add-error is to be shown? (non-templates)

it's not ${$tags}{'error'}, and also not some others I tried and which I don't want to list up here.

Any concrete hint? That try and error get's me bored... Smile

Thanx!
Quote Reply
Re: Yet another MyLinks question In reply to
Try the following:

1) Add the following codes near the top of your sub site_html_my_add_error routine:

Code:
my $message = shift;

2) Then add the following codes in your HTML section of the sub-routine:

Code:
print qq~$message~;

Hope this helps.

Regards,

------------------
Eliot Lee....
* Check Resource Center
* Search Forums



[This message has been edited by AnthroRules (edited February 21, 2000).]
Quote Reply
Re: Yet another MyLinks question In reply to
aaaaahhhhhhhhhrrrrrgg!!!

Tried ${$tags}{'message}, $message only, $rec {$message}, ${$tags}{$message}, ... no results.

What the hell is the logic behind this? When I look through mylinks.cgi I find
$OUT{'total'} = $#c+1;
$OUT{'links'} = "";
$OUT{'span'} = "";
, so it's more or less logic to me how to use those. But there's nothing about 'message'. I see somehting like
Code:
if ($c{$e}) {
print $in->header();
&site_html_my_add_error ("Bereits in den Favoriten: $id $e");
return;
, so before I already tried out ${$tags}{$e} and sort of that - but nothing!

From the rest of the links script I already learned that for example $rec{'Title'} will return the site's name, that's logic - but this errormessage drives me crazy!

If there's anyone (Widgetz maybe?) who can tell me the right variable, pls. also give me a short note where and how this is defines. I need to learn this! Wink

Thanks Eliot, for your replies all the time.

Aah, before I get a 'Uh...': all of my subs start like this:
Code:
sub site_html_my_add {
my $tags = shift;
print qq~
<html>
Smile

Denis

[This message has been edited by Denis (edited February 22, 2000).]
Quote Reply
Re: Yet another MyLinks question In reply to
Sorry that didn't work.

Oh well...I tried.

BTW: The logic within mylinks.cgi is SQL...not standard Perl.

Regards,

------------------
Eliot Lee....
* Check Resource Center
* Search Forums

Quote Reply
Re: Yet another MyLinks question In reply to
for the error subroutines it shoudl be

sub name_error {
my $error = shift;
print qq~$error~;
}

------------------
Jerry Su
Links SQL User
------------------
Quote Reply
Re: Yet another MyLinks question In reply to
The codes widgetz and I provided go into the add error sub-routine in the site_html.pl file.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Yet another MyLinks question In reply to
I tried it all, it's not working. I have no clue about SQL, I must admit.

Jerry, is this a subroutine I have to add in site_html.pl or mylinks.cgi, or is it a 'short form' of sub site_html_my_add_error
and you want to tell me I have to add my $error = shift; at the top and then I could use $error to display the message, something close to what Eliot told me at the top of this thread?

Actually I tried that all, but nothing's working.

Pls. one a little more concrete hint, thank you, thank you, thank you!

Denis

[This message has been edited by Denis (edited February 23, 2000).]
Quote Reply
Re: Yet another MyLinks question In reply to
Finally

Thanks, guys for the help! Unfortunately I never knew what I'm doing there, so only now I found that I have to delete
my $tags = shift;
when adding
my $error = shift;
Boy, that was a difficult birth!

Denis
Quote Reply
Re: Yet another MyLinks question In reply to
Glad you figured it out.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Yet another MyLinks question In reply to
Better say 'finally found it'.
What's that doing, the shift a tag?
Is that SQL? I always thought SQL is a sort of database only. I'm gonna buy some books about that stuff...

Smile
Quote Reply
Re: Yet another MyLinks question In reply to
  
Quote:
I'm gonna buy some books about that stuff...

That would be a good idea.

shift is actually a Perl function.

Quote:
Shifts the first value of the array off and returns it, shortening the array by 1 and moving everything down.
Reference: www.perl.com/pub/doc/manual/html/pod/perlfunc/shift.html

Also, look at www.perl.com for more information about Perl coding and functions.

BTW: The better publisher of scripting manuals is O'Reilly...

www.ora.com

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums


[This message has been edited by AnthroRules (edited February 24, 2000).]
Quote Reply
Re: Yet another MyLinks question In reply to
none of mylinks.cgi is SQL... i don't know where you got that idea from..

I did use a different style of programming compared to regular Links 2 code though..

------------------
Jerry Su
Links SQL User
------------------
Quote Reply
Re: Yet another MyLinks question In reply to
Yes, I was already wondering what Eliot meant:

Quote:
BTW: The logic within mylinks.cgi is SQL...not standard Perl.

Probably I got it wrong...
Quote Reply
Re: Yet another MyLinks question In reply to
My fault...My assumption was that Widgetz was using codes similar to what you can find in the SQL scripts for LINKS.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums