Gossamer Forum
Home : Products : Links 2.0 : Customization :

include link to search_result.html in userlist

Quote Reply
include link to search_result.html in userlist
Something difficult for me, but perhaps easy for someone else ;-)
I have the following code on my site.
The code shows a userlist, that means all users and the number of their linkadds.
Example: http://www.gpaed.de/...chtsmaterial/name.pl

My question: Is it possible to include a link in every username to the links.2.0 search query "%name%" so that all linkadds of this user are listed in the search, when someone clicks on a username.
Difficult to explain with my english, but I hope someone can understand!!


Code:

#!/usr/bin/perl
require "admin/links.cfg";
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
$i=0;
open (DB, "<$db_file_name") or &cgierr("Kann die Datei bzw. Verzeichnis nicht öffnen: $db_file_name.\nGrund: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
/^#/ and next LINE;
/^\s*$/ and next LINE;
chomp;
@values = &split_decode($_);
$name[$i] = $values[$db_contact_name];
$i++;
}
close DB;
for (@name){
$list{$_}++;
}
&html_print_headers();
print qq~
<head>
<title>Top-Mitglieder</title>
<LINK href="http://www.gpaed.de/html2/gpaed_aktuell.css"
rel=stylesheet type=text/css><STYLE type=text/css>@import url("http://www.gpaed.de/html2/gpaed_aktuell.css");
</STYLE>
</head>

<DIV id=oben>
<h2><a class="titel" href="index.html" title="h o m e" name="oben">Unterrichtsentwürfe, Trimesterpläne und Materialien für
Sonderpädagogen</a></h2>
<h1>&nbsp;</h1>
<h1><a class="titel" title="h o m e" href="http://www.gpaed.de">Referendariat online</a></h1>
<h3><a class="nav" href="http://www.gpaed.de/html2/gpaed_sitepasswort.shtml" title="gpaed.de auf einen Blick"> &nbsp;Inhalt
</a>-<a class="nav" title="E-Mail und Gästebuch" href="http://www.gpaed.de/html2/gpaed_kontakt.php">
Kontakt&nbsp;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="nav" href="http://www.gpaed.de/cgi-bin/unterrichtsentwuerfe/count.cgi?action=jump&amp;URL=http://www.gpaed.de/unterrichtsentwuerfe/" title="UV's für alle Lernbereiche">
Entwürfe </a>-<a class="nav" href="http://www.gpaed.de/cgi-bin/unterrichtsmaterial/count.cgi?action=jump&amp;URL=http://www.gpaed.de/unterrichtsmaterial/"> Materialien </a>-<a class="nav" href="http://www.gpaed.de/cgi-bin/unterrichtsmaterial/count.cgi?action=jump&amp;URL=http://www.gpaed.de/unterrichtsplanung/"> Planungen </a>-<a class="nav" title="Diskussionen und Ideen" href="http://www.gpaed.de/forum/"> Forum </a>-<a class="nav" href="http://www.gpaed.de/4images/categories.php?cat_id=6">
Kunstwerke </a>-<a class="nav" href="http://www.gpaed.de/cgi-bin/literaturtipps/count.cgi?action=jump&amp;URL=http://www.gpaed.de/literaturtipps/" title="für die Unterrichtsvorbereitung">
Literatur&nbsp;</a>-<a class="nav" href="http://www.gpaed.de/cgi-bin/webtipps/count.cgi?action=jump&amp;URL=http://www.gpaed.de/webtipps/" title="für die Unterrichtsvorbereitung">
Webtipps&nbsp;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="nav" href="http://www.gpaed.de/html2/gpaed_kurzbio.shtml" title="Autor, Copyright usw.">
Impressum&nbsp;</a>
</h3>
</DIV>
<DIV id=mitte>
<h1 align="left"><br>Top-Mitglieder in Unterrichsmaterialien</h1>
<p>In Klammern die Anzahl der zur Verfügung gestellten Unterrichtsmaterialien<br>
<ol><li>
~;
foreach $key (sort {$list{$b} <=> $list{$a} } keys %list)
{
print "$key ($list{$key} Materialien)";
print "<li>";
}
print qq~
</ol>
<p>&nbsp;</p>
<p align="center">weitere Top-Mitglieder in</p>
<p align="center"><a href="http://www.gpaed.de/cgi-bin/unterrichtsentwuerfe/name.pl">Entwürfe</a> :: <a href="http://www.gpaed.de/forum/statistics.php#topposter">Forum</a> :: <a href="http://www.gpaed.de/cgi-bin/webtipps/name.pl">Webtipps</a> :: <a href="http://www.gpaed.de/cgi-bin/literaturtipps/name.pl">Literaturtipps</a></p>
<p>&nbsp;</p>
<p><a href="javascript:history.back()">&lt;&lt; zurück</a></p>
<p>&nbsp;</p>
</div>






Matthias
gpaed.de

Last edited by:

Matthias70: Feb 26, 2006, 7:51 AM
Quote Reply
Re: [Matthias70] include link to search_result.html in userlist In reply to
Sounds easy enough...

Explain that the name links to search results, add the red and change your <li> tags by removing the blue:

<p>In Klammern die Anzahl der zur Verfügung gestellten Unterrichtsmaterialien<br>
<ol><li>
~;
foreach $key (sort {$list{$b} <=> $list{$a} } keys %list)
{
print "<li><a href=\"$db_cgi_url/search.cgi?query=$key&mh=10&type=keyword&bool=and\">$key</a> ($list{$key} Materialien)";
print "<li>";
}


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] include link to search_result.html in userlist In reply to
Hi Leonard,

thank you for your fast reply and the perfect code.

Matthias

Matthias
gpaed.de