Not all of the below are properly documented. jdporter expressed interest in remedying that situation. This was a quick way to get the information available to anyone who wanted to contribute...
| Setting | Value |
|---|---|
| cpan | my $escapedname=$query->escape($nodeloc); my $cpantitle= $title || $nodeloc; my $mode=$VARS->{cpan_link_args} || 'mode=module'; return qq[<a href="http://search.cpan.org/search?$mode&query=$escapedname">$cpantitle</a>]; |
| dict | my $escapedname = $query->escape($nodeloc); my $x = $title || $nodeloc; return qq[<a href="http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=$escapedname">$x</a>]; |
| dist | (my $search = $nodeloc) =~ tr/: \-/-/s; $search = $query->escape($search); return qq[<a href="http://search.cpan.org/dist/$search">$cpantitle</a>]; |
| doc | if ($escapedname =~ /^perl/) {qq[<a href="http://perldoc.perl.org/$escapedname.html">$cpantitle</a>];} else {qq[<a href="http://perldoc.perl.org/functions/$escapedname.html">$cpantitle</a>];} |
| ftp | return $title ? qq[<a href="ftp://$nodeloc">$title</a>] : qq[<a href="ftp://$nodeloc">$nodeloc</a>]; |
| my $escapedname=$query->escape($nodeloc); my $cpantitle= $title || $nodeloc; return qq[<a href="http://www.google.com/search?q=$escapedname">$cpantitle</a>]; | |
| href | $nodeloc!~/^(javascript|about|mocha):/i ? qq[<a href="$nodeloc">$cpantitle</a>] : $nodeloc ne $cpantitle ? "[href://$nodeloc|$cpantitle]" : "[href://$nodeloc]" |
| http | return $title ? qq[<a href="http://$nodeloc">$title</a>] : qq[<a href="http://$nodeloc">http://$nodeloc</a>]; |
| https | return $title ? qq[<a href="https://$nodeloc">$title</a>] : qq[<a href="https://$nodeloc">https://$nodeloc</a>]; |
| id | if($nodeloc=~/\D/) {return "[$inner]"} else { if (!$nodeloc) { $nodeloc=17441; $title||='[id://]'; } return $title ? linkNode($nodeloc,$title) : linkNode($nodeloc) }; |
| isbn | $nodeloc =~ tr/0-9Xx//cd; my $cpantitle = $title || "ISBN $nodeloc"; "<a href='http://isbn.nu/$nodeloc'>$cpantitle</a>"; |
| jargon | return qq[<a href="http://www.science.uva.nl/cng/search/htsearch.CGI?words=$escapedname&restrict=%2F%7Emes%2Fjargon%2F">$cpantitle</a>]; |
| kobe | return qq[<a href="http://cpan.uwinnipeg.ca/search?query=$escapedname&mode=module">$cpantitle</a>]; |
| kobes | return qq[<a href="http://cpan.uwinnipeg.ca/search?query=$escapedname&mode=module">$cpantitle</a>]; |
| link | $nodeloc!~/^(javascript|about|mocha):/i ? qq[<a href="$nodeloc">$cpantitle</a>] : $nodeloc ne $cpantitle ? "[link://$nodeloc|$cpantitle]" : "[link://$nodeloc]" |
| lj | return qq[<a href="http://livejournal.com/users/$nodeloc">$cpantitle</a>]; |
| localtime | $nodeloc="" if $nodeloc=~/now/i; return htmlcode('parseTimeInString','',$nodeloc, undef, 1); |
| lucky | my $escapedname = $query->escape($nodeloc); my $cpantitle= $title || $nodeloc; return qq[<a href="http://www.google.com/search?q=$escapedname&btnI=I">$cpantitle</a>]; |
| mod | my $escapedname=$query->escape($nodeloc); my $cpantitle= $title || $nodeloc; return qq[<a href="http://search.cpan.org/search?module=$escapedname">$cpantitle</a>]; |
| module | my $escapedname=$query->escape($nodeloc); my $cpantitle= $title || $nodeloc; return qq[<a href="http://search.cpan.org/search?module=$escapedname">$cpantitle</a>]; |
| node | return htmlcode('node_link','',$inner,$nodeloc,$title,$cpantitle); |
| pad | return htmlcode('scratchpad_link', '', $nodeloc||$AUTHOR->{title}, $title,{}); |
| perldoc | return qq[<a href="http://www.perldoc.com/cgi-bin/htsearch?&words=$escapedname">$cpantitle</a>]; |
| pmdev | return htmlcode('pmdev_link','',$inner); |
| wp | my $lang = $VARS->{wp_lang} || 'en'; my $art = $nodeloc; $art =~ tr/ /_/; my $url = "http://$lang.wikipedia.org/wiki/$art"; return qq[<a href="$url">$cpantitle</a>]; |
node_link:
my ($inner,$nodeloc,$title,$htmltitle)=@_; return "[$inner]" unless $nodeloc; my $N; my ($node,$view,$type)=split /;/,$nodeloc; { if ($type and my $T=getType($type)) { last if $N=getNode($node,$T); } if ($node=~/^\d+$/) { $N=getNodeById($node); } else { ($N)=getNodeWhere({title=>$node}); } } return "[$inner]" unless $N; return linkNode($N,$title||$N->{title}, { class=> 'node_link', $view ? (displaytype => $view) : () } );
scratchpad_link:
my ($user_spec, $text, $linktype, $idonly, $create) = @_; # $user_spec => a $USER object, a users id, or a users name # $text => text to use for link # $linktype => a hash of parameters to add to the links url # $idonly => we want an ID back ONLY # $create => create the scratchpad if necessary # Do some juggling to manage the different forms of $user_spec my $user; if (ref $user_spec) { # Its an object $user=$user_spec; } else { # Its either an id or a name. The || is to handle any pesky users # who have a number for a name. Not sure if thats legal, but we che +ck anyway. $user = $user_spec=~/\D/ ? getNode($user_spec, 'user') : ( getNodeById($user_spec) || getNode($user_spec, 'user') ); # Bail if we still have no $user (we can't create without a user so # that flag is irrelevent here) unless ($user) { return $idonly ? "" : linkNode(108949, ($text || "$user_spec\'s scratchpad"), { user=> $user_spec } ) } } # at this point we have a valid $user object my $user_id = $user->{user_id}; my $user_title = $user->{title}; # [demerphq] commented the following out for now because # Anonymonk _has_ a scratchpad. Maybe one day the gods # will put something useful there... # # return $idonly ? "" : 'Anonymonk has no scratchpad!' # if and getId($user) == $HTMLVARS{guest_user}; # Fetch the pad my $ret={user=>$user}; my ($pad_id,$pad_title); if ( htmlcode('get_user_scratchpads','',$ret) ) { ($pad_id,$pad_title) = @{$ret->{pads}[0]}; } # Links to scratchpads go to the scratchpad viewer prior to # creating a proper node. If they actually follow the link # and go to the viewer then the creation will occur because # that node will call us again, but with the magic $create flag if (!$pad_id and !$create) { return "" if $idonly; $text ||= $user_title."'s scratchpad"; return ($linktype && $linktype->{displaytype} eq 'edit') ? linkNode(108949, $text, { user=>$user_title, svmode=>'edit +'}) : linkNode(108949, $text, { user=>$user_title }) } else { $text||=$pad_title; } # They either have a pad, or we are supposed to force its creation. # So make a pad if there isn't one already... $pad_id = htmlcode('createscratchpad', '', $user,'',1) unless $pad_id; # Sanity clause -- Make sure we actually got one back return $idonly ? "" : "Woah! Bad Mojo in scratchpad_link ($user_id,$text,$u +ser_title)" unless $pad_id; # Return the link/or ID of the scratchpad return $idonly ? $pad_id : linkNode($pad_id, $text, $linktype);
pmdev_link:
my ($inner)=@_; my ($nodeloc,$title,$alt)=$inner=~m#^pmdev://([^|]+)(?:\|([^|]*)(?:\|( +[^|]*))?)?$#; return "[$inner]" unless $nodeloc; my $N; my ($textlink, $display, $comment)=('') x 3; if ($nodeloc=~/^\?/) { $textlink=qq(<a href="$nodeloc">); if (!$title and $nodeloc=~/node(?:_id)?=([^&;]+)/) { $title=$1; } } elsif ($nodeloc=~/\D/) { my ($node,$view,$type)=split /;/,$nodeloc; if ($type) { $comment="<!-- gN $node|$type -->"; my $T=getType($type); $N=getNode($node,$T) if $T; } elsif ($node=~/\D/) { $comment="<!-- gNW $node -->"; ($N)=getNodeWhere({title=>$node}); } else { $comment="<!-- gNBI $node -->"; $N=getNodeById($node); } $display=$view; } else { $comment="<!-- gNBI $nodeloc -->"; $N=getNodeById($nodeloc); }; my $PMDEV=getNode( 'pmdev', 'usergroup' ); return join '',$comment, defined($alt) ? $alt : $title||$N->{title}||"" unless Everything::isApproved($USER,$PMDEV); return "[$inner]" unless $textlink || $N; return join '',$comment, $textlink ? $textlink.$q->escapeHTML($title||$nodeloc)."</a>" : linkNode($N,$title||$N->{title}, $display ? { displaytype => $display } : () ) ;
- tye
In reply to Linking help out-of-date by tye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |