XFeed RSS/Atom feed plugin for CPG 1.5.x - Page 2 XFeed RSS/Atom feed plugin for CPG 1.5.x - Page 2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

XFeed RSS/Atom feed plugin for CPG 1.5.x

Started by Aditya Mooley, August 14, 2009, 11:39:17 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

smartbyte


... when I look at your feed. It ends in a </channel> but it never opens it. maybe it is forgotten in the code somehwere to open a <channel>

Your header:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel>
<title>Photos de montres</title>
<link>http://www.photos-de-montres.com/galeriemontres</link>
<description>Photos des nouvelles montres, nouveautés de l&#039;horlogerie</description>
<language>en-US</language>
<lastBuildDate>Wed, 09 Jun 2010 02:13:05 +0200</lastBuildDate>
<generator>Coppermine RSS Aggregator</generator>


My header:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"                     xmlns:media="http://search.yahoo.com/mrss/"                     xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Kati and Joern Pictures | Album: 2002 Toskana</title>
<link>XXXXXXXXXXXXXXXXXXX</link>
<description>... our gallery</description>
<language>en-US</language>
<lastBuildDate>Tue, 08 Jun 2010 20:29:06 -0400</lastBuildDate>
<generator>Coppermine RSS Aggregator</generator>


So there definetly is something missing. I can check the code, if I have time.

Thanks for that hint.

The gallery listing works for Albums, but not for the Start page...

ericco

Where is this file to modify for add <channel>  ???

papukaija

Quote from: ericco on June 09, 2010, 05:22:03 PM
Where is this file to modify for add <channel>  ???

It's in /plugins/xfeed/xfeed.php

papukaija

Quote from: smartbyte on June 09, 2010, 02:30:15 AM
The gallery listing works for Albums, but not for the Start page...

Confirming. This issue is not related to the channel tag; as you can see in the source code of this start page and this album feed. So there is something in xfeed.php that makes the feed to use the generic image.

ericco

It's not the tag channel, it's other
my xfeed.php attached

ericco


smartbyte

Nahh, nothing yet, I had a look at the two feeds, and they look the same to me, so maybe it's just the length of the feed...
Wee need some RSS knowledge to solve this issue.  :-\

jayhunter

Hey.

Edited in an option to change the position of the RSS Button. Inspired by the Social Bookmarks plugin by Joachim Müller (http://forum.coppermine-gallery.net/index.php/topic,61671.0.html). Took a small code snipped from there too.

Possible options are the old one right above the gallery or parsing to template.htm with placeholder {XFD_BUTTON} which, of course, you can place anywhere in the template.

Edited language files and changend version to 1.9.1 (was 1.7 in lang file but it's based on 1.9 of course..).

Demo @ http://htbackdrops.com
Have Phun

photo2pictures

I have been looking at this post for some time now but still don´t get it.

I tried to install the xfeed plugin for CPG 1.5.x, but I get an error:

Critical error

There was an error while processing a database query.

**************
While executing query '
 
  INSERT INTO `cpg15x_plugin_xfeeds` (
    xfd_rss_button,
    xfd_rss_button_position,
   xfd_standard,
   xfd_google,
   xfd_yahoo,
   xfd_msn,
   xfd_lines,
   xfd_aol,
   xfd_feedburn,
   xfd_feedburnuname,
   xfd_feedroute,
   xfd_customenable1,
   xfd_customenable2,
   xfd_customenable3,
   xfd_customenable4,
   xfd_customenable5,
   xfd_customtitle1,
   xfd_customtitle2,
   xfd_customtitle3,
   xfd_customtitle4,
   xfd_customtitle5,
   xfd_customurl1,
   xfd_customurl2,
   xfd_customurl3,
   xfd_customurl4,
   xfd_customurl5,
   xfd_theme,
    xfd_feed_items)
VALUES (
    1,
    0,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   'undefined',
   0,
   0,
   0,
   0,
   0,
   0,
   'Link Title 1',
   'Link Title 2',
   'Link Title 3',
   'Link Title 4',
   'Link Title 5',
   'http://www.example.com',
   'http://www.example.com',
   'http://www.example.com',
   'http://www.example.com',
   'http://www.example.com',
   3,
    10
)' in plugins/xfeed/codebase.php on line 326

mySQL error: Unknown column 'xfd_rss_button_position' in 'field list'

**************

For the PHP Info, see attached "PHPinfo.txt"...

What else do you want to see or know?

What can I do to solve this problem..?

Best regards,
Brian
Have expertise in HTML and CSS, but PHP is still a bit unclear for me...

jayhunter

Quote from: photo2pictures on October 09, 2010, 07:01:49 AM
I have been looking at this post for some time now but still don´t get it.

I tried to install the xfeed plugin for CPG 1.5.x, but I get an error:
[..]
What can I do to solve this problem..?

Hey.

That's my fault. I just hacked together that 1.9.1 version I posted and forgot to make a clean test installation.

Here you go with a new one.

Keep in mind that I'm not the original maintainer and the versions I post here are not offical in any way.

My personal changelog:

  • Fixed: Error during installation and made basic.sql a little more readable.
  • Removed Bloglines as they are going out of service.
  • Disabled Yahoo! by default. I think there is just an outdated URL used but couldn't figure out which new one to use.
  • Fixed: No thumbnails shown when parameters album and category empty (main page).
  • Fixed: Use urlencode() on the feed url for predefined services

Cheers
Jayhunter

photo2pictures

Thank you - I appreciate the fast response  :) and tried again. Unfortunately it still result in error here, but a slightly different error this time.

Critical Error
There was an error while processing a database query.

***************
While executing query '
 
  INSERT INTO `cpg15x_plugin_xfeeds` SET
    xfd_rss_button=1,
    xfd_rss_button_position=0,
     xfd_standard=1,
     xfd_google=1,
     xfd_yahoo=0,
     xfd_msn=1,
     xfd_aol=1,
     xfd_feedburn=0,
     xfd_feedburnuname='undefined',
     xfd_feedroute=0,
     xfd_customenable1=0,
     xfd_customenable2=0,
     xfd_customenable3=0,
     xfd_customenable4=0,
     xfd_customenable5=0,
     xfd_customtitle1='Link Title 1',
     xfd_customtitle2='Link Title 2',
     xfd_customtitle3='Link Title 3',
     xfd_customtitle4='Link Title 4',
     xfd_customtitle5='Link Title 5',
     xfd_customurl1='http://www.example.com',
     xfd_customurl2='http://www.example.com',
     xfd_customurl3='http://www.example.com',
     xfd_customurl4='http://www.example.com',
     xfd_customurl5='http://www.example.com',
     xfd_theme=3,
    xfd_feed_items=10
  ' in plugins/xfeed/codebase.php on line 321    <<<--- it has changed from line 326 to 321

mySQL error: Unknown column 'xfd_rss_button_position' in 'field list'

***************

For the PHP Debug Info, see attached "PHPinfo2.txt"...

I tried to CHMOD all xfeed folders and files to 777 without any positive results.

Can it be the server PHP configuration..?
Have expertise in HTML and CSS, but PHP is still a bit unclear for me...

jayhunter

Quote from: photo2pictures on October 09, 2010, 12:22:37 PM
Thank you - I appreciate the fast response  :) and tried again. Unfortunately it still result in error here, but a slightly different error this time.

No problem ..

Quote from: photo2pictures on October 09, 2010, 12:22:37 PM
  ' in plugins/xfeed/codebase.php on line 321    <<<--- it has changed from line 326 to 321

mySQL error: Unknown column 'xfd_rss_button_position' in 'field list'
The error has change quite a bit more .. but that doesn't matter.

You will have to completly delete xfeed. For me it worked just by removing it throu the plugin manager (not just uninstall!).
Please remove the plugin, delete the plugins/xfeed folder and - very important - check the database directly (phpmyadmin) if the table 'cpg15x_plugin_xfeeds' got removed. If not, do that by hand.

Now you are ready to try again. :)

Quote from: photo2pictures on October 09, 2010, 12:22:37 PM
I tried to CHMOD all xfeed folders and files to 777 without any positive results.

Can it be the server PHP configuration..?
Chmod or the server configuration has nothing to do with this. It's a database related error.

Hope you get it working.

Cheers
Jayhunter

papukaija

@photo2pictures: Your gallery is located at http://www.photo2pictures.com/gs/  (the board rules require you to post a link to your gallery for support requests).

photo2pictures

To papukaija: Sorry, and thanks.

To jayhunter: It helped. I deleted 'cpg15x_plugin_xfeeds' from MySQL tables and xfeed files and folders. Then I made a new install, and now it seems to work :)

I will report if I run into problems, thanks for your help so far, both of you, it was really great !!

:)
Have expertise in HTML and CSS, but PHP is still a bit unclear for me...

csman

Having feeds is a must, so thanks a lot to the author. One problem: for me (PHP 5.2.10), it mangled all titles and comments in UTF-8 (specifically, Cyrillic), making the feed unusable. To get around that, I tweaked xfeed.php:

every time htmlentities(...) is called, change that to htmlentities(...,ENT_COMPAT,"UTF-8");

That seems to have fixed some encoding issues, however some other entities in captions, such as laquo; were still breaking the resulting feed. I fixed it by carefully replacing &laquo with &amplaquo with a preg. Someone can have some real feed problems without the above!

Minor - BBCode such as [url= shows up unformatted in the RSS feed.

jayhunter

Quote from: csman on November 14, 2010, 05:01:38 AM
One problem: for me (PHP 5.2.10), it mangled all titles and comments in UTF-8 (specifically, Cyrillic), making the feed unusable. To get around that, I tweaked xfeed.php:

every time htmlentities(...) is called, change that to htmlentities(...,ENT_COMPAT,"UTF-8");

That seems to have fixed some encoding issues, however some other entities in captions, such as laquo; were still breaking the resulting feed. I fixed it by carefully replacing &laquo with &amplaquo with a preg. Someone can have some real feed problems without the above!

Let's fix that for everyone ...

The problems you encountered with &laquo; can be resolved by using htmlspecialchars() instead of htmlentities().

Quote from: csman on November 14, 2010, 05:01:38 AM
Minor - BBCode such as url= shows up unformatted in the RSS feed.

No problem :)

So here is a new version for you guys.
Keep in mind that I'm not the original maintainer and the versions I post here are not offical in any way.

My personal changelog:

  • Fixed: charset problem by replaced all htmlentities( ... ) with htmlspecialchars( ... , ENT_COMPAT, $CONFIG['charset']). This will keep the configured charset working.
  • Fixed: bbcode not being parsed in caption and keywords. (No smilies though)

Hope this works for everyone. Did test it on two sites and w3.org validates the feeds in UTF8 .. execpt for a missing DOCTYPE.

Cheers Jayhunter

DaMysterious

#36
Today some glitches came through ligt on my system using the latest 1.9.3.

Debug info for that part:

\plugins\xfeed\codebase.php

    * Notice line 75: Use of undefined constant ecards_more_pic_target - assumed 'ecards_more_pic_target'
    * Notice line 92: Use of undefined constant ecards_more_pic_target - assumed 'ecards_more_pic_target'
    * Notice line 105: Use of undefined constant ecards_more_pic_target - assumed 'ecards_more_pic_target'


Solution for my situation:
I searched(three occurrences)

$CONFIG[ecards_more_pic_target]

replace with

$CONFIG['ecards_more_pic_target']


At last search

    return $template_header.$html;

replace with

    // return $template_header.$html;
    return $html;



In file xfeed.php a errors did came up for me.

Critical error

While executing query 'SELECT pid,aid,filepath,filename,url_prefix,pwidth,pheight,filesize,ctime,title,keywords,votes,pic_rating,hits,caption,owner_id,u.user_name FROM cpg15x_pictures r, cpg15x_users u
            WHERE (1) AND r.owner_id = u.user_id AND approved = 'YES' ORDER BY pid DESC LIMIT 0, 10' in plugins\xfeed\xfeed.php on line 87


I searched

    $query = "SELECT pid,aid,filepath,filename,url_prefix,pwidth,pheight,filesize,ctime,title,keywords,votes,pic_rating,hits,caption,owner_id,u.user_name FROM {$CONFIG['TABLE_PICTURES']} r, {$CONFIG['TABLE_USERS']} u

replaced with

    $query = "SELECT r.pid,r.aid,r.filepath,r.filename,r.url_prefix,r.pwidth,r.pheight,r.filesize,r.ctime,r.title,r.keywords,r.votes,r.pic_rating,r.hits,caption,r.owner_id,u.user_name FROM {$CONFIG['TABLE_PICTURES']} r, {$CONFIG['TABLE_USERS']} u


Possible this will work to for other server set-ups. At last the errors did disappear for me.
DaMysterious.

cdeome

Quote from: ericco on June 08, 2010, 11:12:01 PM
Hello, excuse me for my english  :-\

Why the picture not appears http://www.photos-de-montres.com/galeriemontres/index.php?file=xfeed/xfeed
And also the older last adds picture, only the last
Thk

I agree, all I see is an empty film can.   Is there plans to add the thumbnail to the RSS Item?  I want to have the latest image shown when I pull up the RSS entry.

Does that make sense?  http://deome.net/gallery

Αndré

Just made a short test with the lastup meta album: http://deome.net/gallery/index.php?file=xfeed/xfeed&album=lastup

Works as expected. That's curious behavior, as the default feed and the lastup feed displays the same images. So maybe there's a bug in the plugin.

jayhunter

Check out my unofficial version from this post:

http://forum.coppermine-gallery.net/index.php/topic,61197.msg337765.html#msg337765

It has the missing thumbnail bug and some others fixed.

Quote from: Αndré on January 29, 2011, 11:14:43 AM
That's curious behavior, as the default feed and the lastup feed displays the same images. So maybe there's a bug in the plugin.

xfeed really is not programmed with style. There are three (if I remember correct) different SQL querys that basically do the same thing and stuff like that. One of them is not correct in the original plugin, explaining the missing thumbs only in some feeds.

What behavior would you expect from the default feed instead of showing the latest additions?

Cheers,
Jayhunter