Page 1 of 1

Question displaying RSS aggregator properties (no luck yet)

Posted: Thu Jul 13, 2006 10:46 pm
by eburrows
I updated entries.tpl to include some of the extended properties for the entries in the RSS feed I am aggregating. But for some reason I am not having luck displaying this information. I have tried multiple things but to no avail.

For example I added the following to entries.tpl:

------------------------------------------------------------------------

{if $entry.properties.ep_aggregator_feed eq ""}
<b>No rss value</b>
{/if}

{$entry.properties.ep_aggregator_articleurl}
------------------------------------------------------------------------

So I went into edit mode and previewed the result and the articleurl doesn't appear and it says it echos "No rss value"!! I went into the code and echoed out the entry id and then went into the database and looked for the entries for that entry id in the extendedproperties table. I know those fields have values but for some reason it won't access them. Is there something that I am missing? I went back through the code and edited entries.inc.php and functions_entries_admin.inc.php and am able to display the articleurl that way but for a variety of reasons I would rather use the simpler smarty call.

Is there something I am doing wrong or missing? I know that smarty can read my extendedproperties table because I added an extended field and can properly display that in my entry.. just for some reason I can't access any of the aggregator fields.

Any help would be great!
Evan

Re: Question displaying RSS aggregator properties (no luck y

Posted: Fri Jul 14, 2006 12:02 pm
by garvinhicking
Hi!

What happens on the frontend of your blog (NOT the preview mode), is it displayed there?

Which s9y version are you using?

What is the output of a

Code: Select all

SELECT * FROM serendipity_entryproperties WHERE entryid = <YOUR-ENTRY-ID>
?

Best regards,
Garvin

Posted: Fri Jul 14, 2006 2:24 pm
by eburrows
Garvin,

No, when I publish an article it isn't displayed either. It just seemed weird to me because filtering through the entries in entryproperties i found other types of properties that I can successfully display using entries.tpl. For example I can display a custom field that I added and I just randomly selected properties to since if they displayed..

{if $entry.properties.ep_access}
<b>access = {$entry.properties.ep_access}</b>
{/if}

that call displays 'access=public' in both preview and publish mode. Here is an output of mysql when querying one of the aggregator entries

------------------------------------------
mysql> select * from serendipity_entryproperties where entryid = '421';
+---------+--------------------------+--------------------------------------------------------------------+
| entryid | property | value |
+---------+--------------------------+--------------------------------------------------------------------+
| 421 | ep_aggregator_articleurl | http://sciencenow.sciencemag.org/cgi/co ... 03/2?rss=1 |
| 421 | ep_aggregator_categoryid | NULL |
| 421 | ep_aggregator_feed | 4 |
| 421 | ep_aggregator_feedname | Science Magazine |
| 421 | ep_aggregator_feedurl | http://sciencenow.sciencemag.org/rss/current.xml |
| 421 | ep_aggregator_htmlurl | NULL |
+---------+--------------------------+--------------------------------------------------------------------+
6 rows in set (0.00 sec)
------------------------------------------

Sorry for the bad and ugly formatting, but as you can see there are entries there smarty just for some reason doesn't see it.
I am using Serendipity 1.0-beta3

thanks again for the help,
Evan

Posted: Fri Jul 14, 2006 2:55 pm
by garvinhicking
Hi!

Hm, the output you showed me only has the ep_aggregator_* fields in it. Could you try to edit such an article and insert a s9y custom property field to see if that gets inserted?

You do have the "Extended Properties" event plugin installed, right? Which version is it?

You might want to use

Code: Select all

<pre>{$entry.properties|@print_r}</pre>
in your smarty template to check how the complete properties array is presented there. (You might need to set

Code: Select all

$serendipity['smarty']->security = false;
in a "config.inc.php" file inside your template directory to be able to use print_r!)

The ep_access property is actually joined differently to the SQL query, so this is not really a good example on how to fetch properties, so I'd need to check how it comes that the properties are not all fetched...

Best regards,
Garvin