Gossamer Forum
Home : Products : Gossamer Links : Discussions :

detailed_url on homepage

Quote Reply
detailed_url on homepage
Hello,

I like to use detailed_url on homepage ...

I've tried the global:

Code:
#set detailed URL
sub {
my $id = shift;
if ($id and $CFG->{build_detailed}) {
return "$CFG->{build_detail_url}/$id$CFG->{build_extension}";
}
}


and call it with

<%get_detailed_url($ID)%>

but this returns

www.mydomain/detailed_pages/ID.html

instead of:

www.mydomain/detailed_pages/category/subcategory/titleID.html

I guess the problem might also be, that I'm using the plugin "staticURLtr" to strip out special chars ...

Is there a way?

Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [kailew] detailed_url on homepage In reply to
I've installed the UltraGlobals ... can I use:

<%Plugins::ULTRAGlobals::Load_Link('ID')%>?

Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [kailew] detailed_url on homepage In reply to
Hi,

Where / what do you want to use a detailed_url from? Is there a global you are using to actually load links onto the homepage? Cos thats where you would need to actually get the URL created... otherwise you are making double the work :))

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] detailed_url on homepage In reply to
Hello Andy,

I've different globals (please don't wonder, this is very mixed stuff, because I did this globals and the other things at total different times and with total different tips ... It worked for me well since years so I didn't have to change it ...):

1. a Top-10-List:


global:

Code:
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 10');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { top5_loop => \@output };
}

template:
Code:
<%top5%>
<%loop top5_loop%>
<div class="abstand">
<%row_num%>
. <a class="noline" href="<%db_cgi_url%>/detail_page.cgi?ID=<%ID%>"><%Title%></a>

2. then a list with newest links.

global:
Code:
sub {
# Displays the newest links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 10');
$sth = $search_db->select ( { isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
if (length $link->{Title} > 50) {
$link->{Title} = substr($link->{Title}, 0, 50) . '...';
}
$output .= Links::SiteHTML::display ('new_links', $link);
}
return $output;
}
template:
Code:
<%newest_links%>

and (new_links.html):
Code:
<li class="linkliste">
<a class="noline" href="<%db_cgi_url%>/detail_page.cgi?ID=<%ID%>"><%Title%></a>
<br class="half">
<span class="greytext">->&nbsp;Seit:&nbsp;<%GT::Date::date_transform($Add_Date, '%yyyy%-%mm%-%dd%', '%dd%.%mm%.%yyyy%')%></span></li>


3. a list with featured links:


template:
Code:
<%list_isbest%>
<%loop All_Loop%>
<li class="linkliste"><a class="noline" href="<%db_cgi_url%>/detail_page.cgi?ID=<%ID%>">
<%Title%>
<span class="greytext">&nbsp;(<%Hits%>)</span></a></li>
<%endloop%>

global:
Code:
sub {
# Displays 10 premium-links.
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Add_Date DESC','LIMIT 10');
my $sth = $table->select({ isBest => 'Ja' });
my @output;
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
push (@output, $link);
}
return { All_Loop => \@output };
}

4. and another list with the newest links:

global:
Code:
sub {
#Top 10 sites by hits.
my ($output,$sth,$link);
my $id = shift;
my $db = $DB->table ('Links');
$db->select_options ('ORDER BY Add_Date DESC', 'LIMIT 3');
my $sth = $db->select ( { isValidated => 'Yes'} );
my $premium;
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link3', $link);
}
return $output;
}

template:
Code:
<%is_best%>

and (link3.html)

Code:
<br>
<div class="menuline"><a class="noline" href="<%db_cgi_url%>/detail_page.cgi?ID=<%ID%>"><%Title%></a><span class="greytext"> seit <%GT::Date::date_transform($Add_Date, '%yyyy%-%mm%-%dd%', '%dd%.%mm%.%yyyy%')%>.</span></div>
<div class= "menutext"><%short_desc%></div>
<br class="half">

I like to change all the "detail_page_cgi"-stuff into detailed url, because I've these oretty URLs but dont't use them enough - I think. I don't want to mix the ways to get the detailed page anymore ...

Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [kailew] detailed_url on homepage In reply to
Hi,

In each of your globals, you need to find:

Code:
while (my $link = $sth->fetchrow_hashref) {

...and add this below it:

Code:
$link->{detailed_url} = "$CFG->{build_detail_url}/". $DB->table('Links')->detailed_url( $link->{ID} ) ;

...so we end up with:

Code:
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = "$CFG->{build_detail_url}/". $DB->table('Links')->detailed_url( $link->{ID} ) ;
... rest of code

This should then give you access to <%detailed_url%> from your globals.

Hope that helps.

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] detailed_url on homepage In reply to
Hi Andy,

seems to be very good, thx!

I'm not sure about the third one, because there is a definition:

Code:
$link->{detailed_url} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
should I change it to:

Code:
$link->{detailed_url} = "$CFG->{build_detail_url}/". $DB->table('Links')->detailed_url( $link->{ID} ) ;

or leave it?

Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [kailew] detailed_url on homepage In reply to
Hi,

Glad that worked. For the 3rd one, you may be better to change it. Although the line that is there at the moment will work, it will break if you ever changed your build_detail_format options away from just ID.html.

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] detailed_url on homepage In reply to

Hi Andy,

maybe only one thing left:

In "people who clicked" which is from you, I like to change it also ... Wink

Kai


___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [kailew] detailed_url on homepage In reply to
Hi,

Which version are you using? Version 1.4 seems to already have the <%detailed_url%> tag:

Code:
if ($CFG->{build_detailed}) { $link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} ); }

...or are you using an older version? (I seem to remember < 1.4 didn't have detailed_url as an available tag)

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] detailed_url on homepage In reply to
I'm using 1.3 ... then I'll uprade to the newest one ...

Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [kailew] detailed_url on homepage In reply to
I've updated but I think it's not working.

On a dynamic page a correct link looks like this:

Code:
http://www.portugal-links.de/cgi-bin/page.cgi?g=portugalseiten%2F394.html;d=1

but the link in PeopleWho Clicked looks like this:
Code:
http://www.portugal-links.de/cgi-bin/page.cgi?g=10051.html;d=1
Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [kailew] detailed_url on homepage In reply to
sorry, I think it's working now!

thx

Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [kailew] detailed_url on homepage In reply to
sorry again, there's a mistake ...

correct would be

Code:
http://www.portugal-links.de/portugalseiten/Portugal/Medien/Radio_Comercial_78.html
but the plugin shows

Code:
http://www.portugal-links.de/Portugal/Medien/Radio_Comercial_78.html
Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [Andy] detailed_url on homepage In reply to
Andy,

There is typo in this line:

Code:
if ($CFG->{build_detailed}) { $link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} ); }

It should be instead:

Code:
if ($CFG->{build_detailed}) { $link->{detailed_url} = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} ); }

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] detailed_url on homepage In reply to
Hi,

I've just found the typo by myself (I'm really proud ... Wink) and fixed it, thx!

Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Quote Reply
Re: [eupos] detailed_url on homepage In reply to
Yeah, thats cos when I wrote the plugin back in 2008 that option didn't exist Whistle It used to just be build_root_url/Detailed/ID.html

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!