Hmm spoke too soon... Workes great in dynamic mode.... but doesnt work in static.
Its missing the directory where files are built in.
Sample should be: http://www.site.com/detailed/something/other/page_1234.html
Its building: http://www.site.com/something/other/page_1234.html
So all links are broken. Doesnt happen in dynamic only in static.
Any ideas?
Here is my loop:
<%if user_links.length%>
<ul style="text-align: left">
<%loop user_links%>
<li><%include link.html%></li>
<%endloop%>
</ul>
<%endif%>
Here is the global:
my $user1 = $_[0];
# normal links
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC','LIMIT 300') || die $GT::SQL::error;
my $sth = $link_db->select( { isValidated => "Yes", URL => $user1 } ) || die $GT::SQL::error;
my @links;
# just normal links.
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
push @links, $link;
}
# ratings
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Rating DESC', 'LIMIT 10') || die $GT::SQL::error;
my $sth = $link_db->select( { isValidated => "Yes", ID => $user1 } ) || die $GT::SQL::error;
my @links2;
# just top rated links.
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
push @links2, $link;
}
# ratings
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Hits DESC', 'LIMIT 10') || die $GT::SQL::error;
my $sth = $link_db->select( { isValidated => "Yes", ID => $user1 } ) || die $GT::SQL::error;
my @links3;
# just top rated links.
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
push @links3, $link;
}
return { user_links => \@links , user_links_by_hit => \@links3, user_links_by_rating => \@links2 }
}
anyone see where its missing something?
Thanks,
Juan Carlos
Its missing the directory where files are built in.
Sample should be: http://www.site.com/detailed/something/other/page_1234.html
Its building: http://www.site.com/something/other/page_1234.html
So all links are broken. Doesnt happen in dynamic only in static.
Any ideas?
Here is my loop:
Code:
<%users_listings($URL)%> <%if user_links.length%>
<ul style="text-align: left">
<%loop user_links%>
<li><%include link.html%></li>
<%endloop%>
</ul>
<%endif%>
Here is the global:
Code:
sub { my $user1 = $_[0];
# normal links
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC','LIMIT 300') || die $GT::SQL::error;
my $sth = $link_db->select( { isValidated => "Yes", URL => $user1 } ) || die $GT::SQL::error;
my @links;
# just normal links.
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
push @links, $link;
}
# ratings
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Rating DESC', 'LIMIT 10') || die $GT::SQL::error;
my $sth = $link_db->select( { isValidated => "Yes", ID => $user1 } ) || die $GT::SQL::error;
my @links2;
# just top rated links.
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
push @links2, $link;
}
# ratings
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Hits DESC', 'LIMIT 10') || die $GT::SQL::error;
my $sth = $link_db->select( { isValidated => "Yes", ID => $user1 } ) || die $GT::SQL::error;
my @links3;
# just top rated links.
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
push @links3, $link;
}
return { user_links => \@links , user_links_by_hit => \@links3, user_links_by_rating => \@links2 }
}
anyone see where its missing something?
Thanks,
Juan Carlos