Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Display new links. No link to detailed page...

(Page 1 of 2)
> >
Quote Reply
Display new links. No link to detailed page...
Hello linksSQL people,

I installed the global new links to display the last X links. My links1.html is a copy from the original links.html from the mint template set.
Everything works fine BUT: new links doesn't show the link tot the detailed page!

I build detailed. (The details link works fine in the "normal link to the detailed page ")
Below is a print of my link1.html

I hope someone can help me.

Thanks,
Ron

----------------------------------------------------------------------------------------------------------------------------
<%--
File : link1.html
Description : Show new links (copy from links.html) This file displays a single link. It is used on category listings,
search results, what's new, what's cool, pretty much anywhere you
see a link.
Tags : You have all the properties of a link available on this page, plus:
detailed_url => The URL to the detailed page (if enabled in admin).
isLinkOwner => True if the logged in user owns this link (used to
provide a link to the modify form).
--%>

<ul>
<li>
<%body_font%><a class="category_links" target="_blank" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a></font>

<%if isNew%>
&nbsp;<%body_font%><font color="#CC0000"><sup>new</sup></font></font>
<%endif%>

<%if isChanged%>
&nbsp;<%body_font%><font color="#CC0000"><sup>updated</sup></font></font>
<%endif%>

<%if isPopular%>
&nbsp;<%body_font%><font color="#6699cc"><small><sup class="pop">pop</sup></small></font></font>
<%endif%>
<br>

<%if Description%>
<%body_font%><%Description%></font><br>
<%endif%>

<%if URL%>
<%body_font%><font color="#B1D0A6"><%URL%></font></font><br>
<%endif%>

<%if Review_Count%>
<a href="<%db_cgi_url%>/review.cgi?ID=<%ID%>">Read <%Review_Count%> Reviews</a><br>
<%endif%>

<%body_font%><small>(Added: <%Add_Date%> Hits: <%Hits%> Rating: <%Rating%> Votes: <%Votes%>) </small></font>

<%body_font%><small><a href="<%db_cgi_url%>/rate.cgi?ID=<%ID%>">Rate It</a></small></font>
&nbsp;<%body_font%><small><a href="<%db_cgi_url%>/review.cgi?ID=<%ID%>&add_review=1">Review It
</a></small></font>


<%if detailed_url%>
&nbsp;<%body_font%><small><a href="<%detailed_url%>">Details</a></small></font>
<%endif%>

<%if isLinkOwner%>
&nbsp;<%body_font%><small><a href="<%db_cgi_url%>/modify.cgi?LinkID=<%ID%>">Edit this link</a></small></font>
<%endif%>


</ul>
Quote Reply
Re: [rsahertian] Display new links. No link to detailed page... In reply to
Can you post the global you are using? I sounds like you need to create the detailed_url tag in the global.
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Hi,
This is the global newlinks....
------------------------------------------------------
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 5');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link1', $link);
}
return $output;
}
Quote Reply
Re: [rsahertian] Display new links. No link to detailed page... In reply to
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 5');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
$link->{'detailed_url'} = "$CFG->{build_detail_url}/$link->{'LinkID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display ('link1', $link);
}
return $output;
}

Last edited by:

afinlr: Apr 24, 2003, 6:35 AM
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Thanks Laura,

Almost done. I only miss the id.

It comes with .html instead of 99.html

sincerely,
ron
Quote Reply
Re: [rsahertian] Display new links. No link to detailed page... In reply to
Sorry, I think you just need to change LinkID to ID.
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Thanks,

Is your website broken??

Ron
Quote Reply
Re: [rsahertian] Display new links. No link to detailed page... In reply to
Not as far as I know Unsure. Please do pm me if you're having a problem viewing it as I'd really like to know!
The UK High Street
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
FWIW it won't load for me either...just hangs.
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Laura,

Can you send your e-mail address to ron.sahertian@ect.nl.

Thanks...
Quote Reply
Re: [Paul] Display new links. No link to detailed page... In reply to
Yeah, just after I wrote that things went a bit haywire! Thanks.
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Hi,

does the above code from afinlr exclude most recent links that are tagged "not new" ?

Thanks,

Brakkar

Last edited by:

brakkar: May 5, 2003, 8:52 AM
Quote Reply
Re: [brakkar] Display new links. No link to detailed page... In reply to
It selects from your database the links that have isNew set to Yes and isValidated set to Yes. If you have set isNew to No then the link wont be selected. However, isNew is usually set automatically so I'm not sure how long it will stay set to No if it is a new link.
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
I think its possible to be able to set the isnew when admin submits links as it was possible in links2 non sql no ?

Also, is it necessary to modify your code if I want to display along with the link custom fields I have created ?

Thanks in advance,Brakkar
Quote Reply
Re: [brakkar] Display new links. No link to detailed page... In reply to
Its definitely possible to set isNew to No - I'm just not sure whether this would be reset to Yes during a build, repair tables, etc. Maybe not.

If you want to display your custom fields which are in the Links table then you just need to add them as tags to your link1.html template.
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Ok thanks for your answer.
And do you know if its possible to have built the links' category link ?

Cordially,
Brakkar
Quote Reply
Re: [brakkar] Display new links. No link to detailed page... In reply to
A last little question:

is it possible to exlude / include only designated categories from the display ? if yes, how ?

Thanks,

Brakkar
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Hi afinlr,

Could you also show how to ad the tag <%title_linked%> to this Global Sub?

Thank you,

Eddie
Quote Reply
Re: [eddie123] Display new links. No link to detailed page... In reply to
I'm not sure whether this is really the way to do it, but I'm using a plugin to rewrite my title_linked so I need to pass them through the plugin. I assume it will work anyway.

sub {
# Displays the newest links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 5');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
$link->{'detailed_url'} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$link->{'title_linked'} = GT::Plugins->dispatch ("$CFG->{admin_root_path}/Plugins", "build_title_linked", 1, $link->{'Full_Name'});
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
afinlr,

I keep getting this error:


A fatal error has occured:
Can't use string ("1") as a subroutine ref while "strict refs" in use at /usr/home/eddie/www/cgi-bin/admin/GT/Plugins.pm line 91.


Please enable debugging in setup for more details.




Do you have any suggestions? I'm trying to get the <%title_linked%> to show up.

Thank you,

Eddie


Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Hi,

You don't really need a plugin to do that, just a global.

Just create a global:

<%add_title_linked%>

Your global just needs to check the passed in tags, to see if there is a "Title" tag. If there is, then it can return <%title_linked%> in the return hash. If not, it needs to return a value of "0" and you can then use a flag:

<%if title_linked%> ..... <%endif%>

And that will be available in any template that fetches the Link title.

If you LOOP anything, you need to <%add_title_linked%> inside the loop, before you include a template or print anything out.

You should be able to use the code from detail_page.cgi for this, if your code won't stuff into a global.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [eddie123] Display new links. No link to detailed page... In reply to
Hi,

In case you haven't fixed this, I think this should work.

sub {
# Displays the newest links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 5');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
$link->{'detailed_url'} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$link->{'title_linked'} = Links::Build::build('title_linked', $link->{'Full_Name'});
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Hi Laura,

Is it possible to add the breadcrumb for each new link within the global?

Thanks

Brian
Quote Reply
Re: [Teambldr] Display new links. No link to detailed page... In reply to
Is that not <%title_linked%> ?
Quote Reply
Re: [afinlr] Display new links. No link to detailed page... In reply to
Hi Laura,

I actually found out that since the template was cutom I needed to make the cats available within the template as well. So I had to use a loop to grab the cat info and then add the global tag above assigning the cat number to it.

A little trickier than I thought it would be but I did get it done.

Thanks

Brian
> >