Gossamer Forum
Home : Products : Gossamer Links : Discussions :

RSS feed of new daily links mod

Quote Reply
RSS feed of new daily links mod
I did a search on the board a looked around a bit but didn't really find anything.

I want to do a new daily links RSS feed. It would need to be editable so I could make the read more link linked to my detail's page instead of the actually link so that the surfer would see my ads instead of just being taken to the link url.

Would be happy to pay someone to do the mod if anyone knows how and is interested.
---
I'm a very boring lady, very, very boring.
Quote Reply
Re: [Cleo_] RSS feed of new daily links mod In reply to
I assume that you can do this by creating a new template with a global in it that outputs the feed. Something like this:

sub {
my $date = GT::Date::date_get();
my $search_db = $DB->table('Links');
$search_db->select_options ("ORDER BY Title DESC");
my $cond = GT::SQL::Condition->new( 'Add_Date', '=', $date, VIEWABLE);
my $loop = $search_db->select ($cond)->fetchall_hashref;
return {linksloop=>$loop};
}

Then in the template use

<%globalname%>
<%loop linksloop%>
...rss output (use normal links tags)...
<%endloop%>
Quote Reply
Re: [afinlr] RSS feed of new daily links mod In reply to
Wouldn't I need to do a new category or something in order to have this template compile to something?
---
I'm a very boring lady, very, very boring.
Quote Reply
Re: [Cleo_] RSS feed of new daily links mod In reply to
You can add as many new templates as you like. You show them using

yourdomain.com/cgi-bin/page.cgi?p=newtemplatename

This is useful for adding extra pages such as an 'About Us' page but you can put globals inside to do other things.
Quote Reply
Re: [afinlr] RSS feed of new daily links mod In reply to
I'd like to create a daily links RSS feed, and I'm trying to add something like this to my site. I've added the sub to the global templates (called dailyrss), and I used Page Builder to build a custom template to generate the following page:

yourdomain.com/cgi-bin/page.cgi?p=dailyrss

The resulting page includes the new links added that day, however, none of the link URLs are passed to the page. Any ideas how to fix this? Am I missing something? Is their a mod, plugin, or step-by-step tutorial that's been developed since 2006 that might do the trick? Thanks in advance for your help!
Quote Reply
Re: [tester2] RSS feed of new daily links mod In reply to
Hi,

If you are using the global above then the URL should be available. If you have modified it, can you paste your global here?
Quote Reply
Re: [tester2] RSS feed of new daily links mod In reply to
Hi,

If using PageCreator, you either need to access the page as page.html, or when using page.cgi - use page.cgi?page=whatever (and not p=)

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: [afinlr] RSS feed of new daily links mod In reply to
afinlr wrote:
Hi,

If you are using the global above then the URL should be available. If you have modified it, can you paste your global here?

Here's my global called "daily rss"
Quote:
sub {
my $date = GT::Date::date_get();
my $search_db = $DB->table('Links');
$search_db->select_options ("ORDER BY Title DESC");
my $cond = GT::SQL::Condition->new( 'Add_Date', '=', $date, VIEWABLE);
my $loop = $search_db->select ($cond)->fetchall_hashref;
return {linksloop=>$loop};
}

The template I created (called "dailyrss.html") using the Page Builder plugin is:
Quote:
<?xml version="1.0"?>
<rss version="2.0">

<channel>
<title>Links</title>
<description>The following links were just added to the links directory.</description>
<link><%config.build_root_url%></link>

<%dailyrss%>
<%loop linksloop%>
<item>
<title><%Title%></title>
<description><%Description%></description>
<link><%detailed_url%></link>

</item>
<%endloop%>

</channel>
</rss>

Any ideas what might be wrong? Thanks for your help!
Quote Reply
Re: [Andy] RSS feed of new daily links mod In reply to
Andy wrote:
If using PageCreator, you either need to access the page as page.html, or when using page.cgi - use page.cgi?page=whatever (and not p=)

I installed the Page Builder plugin awhile ago, and I'm using it right now. I'll go ahead and will check out PageCreator to see what it can do.

Thanks!
Quote Reply
Re: [tester2] RSS feed of new daily links mod In reply to
Hi,

PageBuilder should do the same thing pretty much (I just brought my own version out, as Yogi seemed to disappear off the face of the earth = ))

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: [tester2] RSS feed of new daily links mod In reply to
The problem is that detailed_url is not a field in the database - it is built by a separate process that is not being called in the global.
If you have a search for detailed_url you should be able to find the line that you need to add to your global to get it to work.
Quote Reply
Re: [afinlr] RSS feed of new daily links mod In reply to
Code:
$hit->{detailed_url} = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} );

Smile

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: [afinlr] RSS feed of new daily links mod In reply to
OK, I see now what I was doing wrong -- thank you, thank you! I replaced "detailed_url" in the template with: "<%config.db_cgi_url%>/jump.cgi?ID=<%ID%>"

I now have a clickable link in my daily RSS feed. Thank you both for your help!!
Quote Reply
Re: [tester2] RSS feed of new daily links mod In reply to
I've sort of adapted this to suit my needs but the basic code is the same. The only problem I have is that it only lists 8 new additions. Can this be extended to display more? Is there something that I can add to the global to do this?
Quote Reply
Re: [MJB] RSS feed of new daily links mod In reply to
Right, I now see that it's only listing 8 because that's how many new links there are today. My 'New' page displays items for the last 7 days so I'm guessing the date part of the global needs some adjustment.
Quote Reply
Re: [MJB] RSS feed of new daily links mod In reply to
Ignore the posts above. I'm now using the XMLResults plug-in and it's working OK now. Cool