Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Detaild link of front page

Quote Reply
Detaild link of front page
At front page I have this code to display last links of front page

Code:
<%LastLinks%>
<%loop LastLinks_loop%>
<div id="l<%ID%>" class="linklisting">
<h4 class="linktitle">
<%if detailed_url and isValidated eq 'Yes'%><a href="<%detailed_url%>"><%elsif URL ne 'http://' and isValidated eq 'Yes'%><a href="<%config.db_cgi_url%>/jump.cgi?ID=<%ID%>"><%endif%><%if highlight%><%Links::Tools::highlight($Title, $query)%><%else%><%Title%><%endif%><%if isValidated eq 'Yes'%><%if detailed_url or URL ne 'http://'%></a><%endif%><%endif%>
</h4>
<%if URL ne 'http://'%><p class="linkurl"><%if isValidated eq 'Yes'%><a href="<%config.db_cgi_url%>/jump.cgi?ID=<%ID%>"><%endif%><%if highlight%><%Links::Tools::highlight($URL, $query)%><%else%><%URL%><%endif%><%if isValidated eq 'Yes'%></a><%endif%><span class="hsmall"> (<%Hits%> hit<%if Hits != 1%>s<%endif%>)</span></p><%endif%>

<p class="linkrating">
<%~if Votes%>
<%~set intRating = $Rating i/ 1%>
<img src="<%Links::Utils::image_url("stars-10-${intRating}.gif")%>" alt="<%intRating%> of 10 stars" title="<%intRating%> of 10 stars" /> (<%Votes%> vote<%if Votes != 1%>s<%endif%>)
<%~endif%>
</p>

<%if Description%><div class="linkdescription"><%if highlight%><%Links::Tools::highlight($Description, $query)%><%else%><%Description%><%endif%></div><%endif%>

<p class="linkactions">
<%~if isValidated eq 'Yes'%>
<%if Review_Count%><a href="<%config.db_cgi_url%>/review.cgi?ID=<%ID%>">Read <%Review_Count%> review<%if Review_Count != 1%>s<%endif%></a><%endif%>
<a href="<%config.db_cgi_url%>/review.cgi?ID=<%ID%>;add_review=1">Write reveiw</a>
<a href="<%config.db_cgi_url%>/rate.cgi?ID=<%ID%>">rate</a>
<a href="<%db_cgi_url%>/recommend_it.cgi?ID=<%ID%>">recomment</a>
<%if config.bookmark_enabled%><a href="<%config.db_cgi_url%>/bookmark.cgi?action=link_add;ID=<%ID%>">Bookmark it</a><%endif%>
<%if isLinkOwner%><a href="<%config.db_cgi_url%>/modify.cgi?LinkID=<%ID%>">Edit</a><%endif%>
</p>

</div>
<%endloop%>

This was copy/paste from link.html template.

This is global tag for this:

Code:
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY ID DESC', 'LIMIT 6');
my $sth = $table->select ({isValidated => "Yes"});
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { LastLinks_loop => \@output };
}

Why a have link to jump.cgi and not detailed page ? (as in other part of site because I have detailed page active).

Thanks.

Regards.

UnReal Network
Quote Reply
Re: [deadroot] Detaild link of front page In reply to
Hi deadroot,
probably you have some links with detailed set to NO

Matthias

Matthias
gpaed.de
Quote Reply
Re: [deadroot] Detaild link of front page In reply to
Hi,

You need this to make it go to detailed_url:

Code:
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY ID DESC', 'LIMIT 6');
my $sth = $table->select ({isValidated => "Yes"});
my @output;
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
push (@output, $link);
}
return { LastLinks_loop => \@output };
}

That should sort it Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Detaild link of front page In reply to
Yep. It's working. Thanks a lot.

Regards.

UnReal Network