Advanced search  

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]

Pages: [1] 2 3 4 5   Go Down

Author Topic: XFeed RSS/Atom feed plugin for CPG 1.5.x  (Read 125650 times)

0 Members and 1 Guest are viewing this topic.

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
XFeed RSS/Atom feed plugin for CPG 1.5.x
« on: August 14, 2009, 11:39:17 am »

Ported the XFeed plugin to 1.5 with lot more feed possibilities.

A feed will be available for every album (including meta albums) and categories. In case of category with no meta album, lastup will be used.

Also, added some config settings like whether to show the RSS button and number of items in feed. The browser's subscribe to feed icon will display all the available feeds (RSS/Atom) with proper labeling.

Demo - http://adityamooley.net/photos/

Download: http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_xfeed_v1.11.zip/download
« Last Edit: March 07, 2012, 10:48:30 am by Αndré »
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #1 on: August 14, 2009, 12:26:50 pm »

Good work Aditya. Much more powerful than my Atom feed plugin for 1.5.

But there is an error. See: http://adityamooley.net/photos/index.php?file=xfeed/xfeed&album=lastalb
Logged

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #2 on: August 14, 2009, 12:59:28 pm »

Thanks for spotting the error. I never tested it with lastalb metaalbum, so never got this error. Its fixed now. I have updated the attachment in first post.
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #3 on: September 02, 2009, 02:14:26 pm »

Aditya. Referring to this thread, you have to replace the function xfd_rss_button with this one:
Code: [Select]
function xfd_rss_button($template_header)
{
    global $XFDSET,$lang_xfeeds,$CONFIG, $album;

    $superCage = Inspekt::makeSuperCage();

    //require('./plugins/xfeed/include/init.inc.php');

    if (!$XFDSET['xfd_rss_button']) {
        return $template_header;
    }

    $xfd_feed = "index.php?file=xfeed/xfeed";

    if ($superCage->get->keyExists('album')) {
        $album = $superCage->get->getRaw('album');
        $xfd_feed .= "&album=$album";
    }

    if ($superCage->get->keyExists('cat')) {
        $cat = $superCage->get->getRaw('cat');
        $cat = (int)$cat;
        $xfd_feed .= "&cat=$cat";
    }

    if ($XFDSET['xfd_feedroute'] == 1) {
        $xfeed_loc = "feeds.feedburner.com/".$XFDSET['xfd_feedburnuname'];
    } else {
        $xfeed_loc = "".str_replace("http://","",$CONFIG[ecards_more_pic_target]).$xfd_feed;
    }

    //static
    $xfeed_title_enc = urlencode($CONFIG['gallery_name']);
    $xfeed_author = "Admin"; // maybe get the first username in the future (gallery creator).

    $html = "
    <!-- BEGIN XFeeds Plugin -->
    <span class=\"xfeeds\">
    <form>
        <select onchange=\"if (this.selectedIndex > 0) location.href=this[this.selectedIndex].value;\">
        <option selected=\"selected\" value=\"\">".$lang_xfeeds['xfd_fe_opts']."</option>
    ";

    if ($XFDSET['xfd_standard'] == 1) {
        $html .= " <optgroup label=\"".$lang_xfeeds['xfd_fe_atom']."\">
        <option value=\"".$CONFIG[ecards_more_pic_target].$xfd_feed."&type=atom\">".$lang_xfeeds['xfd_fe_local_atom']."</option>
        </optgroup>
        ";
    }

    if ($XFDSET['xfd_standard'] == 1 || $XFDSET['xfd_google'] == 1 ||
        $XFDSET['xfd_yahoo'] == 1 || $XFDSET['xfd_msn'] == 1 ||
        $XFDSET['xfd_lines'] == 1 || $XFDSET['xfd_aol'] == 1 ||
        $XFDSET['xfd_feedburn'] == 1 || $XFDSET['xfd_google'] == 1) {

        $html .= " <optgroup label=\"".$lang_xfeeds['xfd_fe_rss']."\">\n";

        if ($XFDSET['xfd_standard'] == 1) {
            $html .= " <option value=\"".$CONFIG[ecards_more_pic_target].$xfd_feed."\">".$lang_xfeeds['xfd_fe_standard']."</option>\n";
        }

        if ($XFDSET['xfd_google'] == 1) {
            $html .= " <option value=\"http://fusion.google.com/add?feedurl=http%3A//".$xfeed_loc."\">".$lang_xfeeds['xfd_fe_google']."</option>\n";
        }

        if ($XFDSET['xfd_yahoo'] == 1) {
            $html .= " <option value=\"http://us.rd.yahoo.com/my/atm/".$xfeed_author."/".$xfeed_title_enc."http%3A//".$xfeed_loc."\">".$lang_xfeeds['xfd_fe_yahoo']."</option>\n";
        }

        if ($XFDSET['xfd_msn'] == 1) {
            $html .= " <option value=\"http://my.msn.com/addtomymsn.armx?id=rss&amp;ut=http://".$xfeed_loc."\">".$lang_xfeeds['xfd_fe_msn']."</option>\n";
        }

        if ($XFDSET['xfd_lines'] == 1) {
            $html .= " <option value=\"http://www.bloglines.com/sub/http://".$xfeed_loc."\">".$lang_xfeeds['xfd_fe_lines']."</option>\n";
        }

        if ($XFDSET['xfd_aol'] == 1) {
            $html .= " <option value=\"http://feeds.my.aol.com/add.jsp?url=http://".$xfeed_loc."\">".$lang_xfeeds['xfd_fe_aol']."</option>\n";
        }

        if ($XFDSET['xfd_feedburn'] == 1) {
            $html .= " <option value=\"http://feeds.feedburner.com/".$xfeed_loc."\">".$lang_xfeeds['xfd_fe_feedburn']."</option>\n";
        }

        $html .= " </optgroup>\n";
    }

    $customRSSOpt = $customRSS = '';
    for ($i = 1; $i <= 5; $i++) {
        if ($XFDSET['xfd_customenable'.$i] == 1) {
            if (empty($customRSSOpt)) {
                $customRSSOpt = "   <optgroup label=\"".$lang_xfeeds['xfd_fe_links']."\" />\n";
            }
            $customRSS .= "  <option value=\"".$XFDSET['xfd_customurl'.$i]."\">".$XFDSET['xfd_customtitle'.$i]."</option>\n";
        }
    }

    $html .= "  $customRSSOpt $customRSS </select>
        <noscript><input type=\"submit\" value=\"go\"></noscript>
    </form>
    </span>

    <!-- END XFeeds Plugin -->
    ";

    return $template_header.$html;
}



Additionally I wonder why you place the config buttin in the sub menu instead of the admin menu ???
Code: [Select]
$thisplugin->add_filter('sub_menu','xfd_add_config_button');

Maybe we should add this plugin to the svn?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #4 on: September 11, 2009, 10:24:09 am »

Added plugin to svn. Moved config button to admin menu. Added admin menu icon. Replaced function xfd_rss_button.

Version 1.6 attached to the initial post.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #5 on: October 09, 2009, 09:08:42 am »

Attached version 1.8 to initial post.
Logged

smoke

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #6 on: March 25, 2010, 09:11:59 pm »

Is it possible to get a feed off of the favpics album? 
Logged

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #7 on: March 26, 2010, 05:10:15 am »

No, its not possible. You will see the favpic feed when you go on favpic page but your RSS reader won't show anything.
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

smoke

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #8 on: March 26, 2010, 11:45:48 pm »

I kind of figured that would be the case with it, but I seem to remember being able to access favourites by user ID before.  Wasn't sure if I was missing out on something obvious when I tried it.

Thanks for a cool plugin.
Logged

Vixs

  • Guest
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #9 on: April 07, 2010, 08:01:59 pm »

How to fix problem displayed color button "RSS" in latest IE8?

In IE8 i see text string "Feed option -->"

Thanks.
Logged

Vixs

  • Guest
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #10 on: April 07, 2010, 08:14:54 pm »

And this plugin "xfeed 1.9" many conflict with "LightBox NotesFor.net (lightbox_notes_for_net): v2.5"

- no displayed "RSS" color buttons, only text string
- not work subscribe any feed-s

tested in FireFox 3.6.3 and latest IE8
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1543
  • aka 'i-imagine'
    • Home Page
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #11 on: April 07, 2010, 09:56:28 pm »

1) You need to post a link to your Coppermine when asking for support - forum rule

2) LightBox is now at ver. 2.7 - see the Support thread
        - it will work with XFeed above LightBox in list of installed plugins

3) Atom feed did work for me (although I had some troubles with RSS) using AtomFeed ver. 1.9 with and without LightBox

Vixs

  • Guest
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #12 on: April 08, 2010, 07:59:53 pm »

1 - http://gallery.art-world.in.ua/
2 - solved
3 - atom plugin not needed, only XFeed

plase help

Quote
How to fix problem displayed color button "RSS" in latest IE8?

In IE8 i see text string "Feed option -->"

CPG 1.5.3 RC, theme - curve (mod)
installed plugin

bbcode_control
dst
fav_button
fetchcontent
lightbox_notes_for_net
no-crop-rotate
onlinestats
xfeed
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1543
  • aka 'i-imagine'
    • Home Page
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #13 on: April 09, 2010, 12:11:34 am »

From what I can see it looks like the issue might be with the non-latin characters. I was able to reproduce it somewhat on my cpg test gallery. The version that I have there might be different than yours so therefore:

To be certain I would suggest that you re-test with no plugins installed. Then if you use Opera you mught be able to see the exact fault. Copy and paste that into your next post.

This error I got on your site was similar o one I got on mine with a Cyrillic title on one picture.
Quote
XML parsing failed: syntax error (Line: 11, Character: 9)

8: <generator>Coppermine RSS Aggregator</generator>
  9:
 10:    <item>
 11:       <title>&ETH;�&ETH;&micro;&ETH;&sup1;&ETH;&middot;&ETH;&deg;&ETH;&para; &ETH;&middot;&ETH;&deg;&Ntilde;�&Ntilde;�&ETH;&deg;&ETH;&sup2;&ETH;&ordm;&ETH;&deg;2</title>
 12:       <link>http://gallery.art-world.in.ua/displayimage.php?pid=28</link>
 13:       <dc:creator></dc:creator>
 14:       <pubDate>Wed, 07 Apr 2010 00:56:56 +0300</pubDate>


Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #14 on: April 09, 2010, 07:26:03 am »

Does the XML file specify the correct encoding in the header?
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1543
  • aka 'i-imagine'
    • Home Page
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #15 on: April 09, 2010, 12:04:51 pm »

Does the XML file specify the correct encoding in the header?

Here is what I see.

Quote
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel>

At the moment this is about all that I can contribute to this one  - I am in too deep my own plugins!


xcruci8

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 2
    • Macsata Family
Add to Yahoo link does not work
« Reply #16 on: May 01, 2010, 08:42:27 am »

Running version 1.5.3 with v1.9 of this plugin.

In codebase.php, part of the add to yahoo link is missing.  I replaced the commented line (line 113) with the line below it and now the link works.

Code: [Select]
if ($XFDSET['xfd_yahoo'] == 1) {
  //$html .= " <option value=\"http://us.rd.yahoo.com/my/atm/".$xfeed_author."/".$xfeed_title_enc."http%3A//".$xfeed_loc."\">".$lang_xfeeds['xfd_fe_yahoo']."</option>\n"
  $html .= " <option value=\"http://us.rd.yahoo.com/my/atm/".$xfeed_author."/".$xfeed_title_enc."/*http://add.my.yahoo.com/rss?url=http%3A//".$xfeed_loc."\">".$lang_xfeeds['xfd_fe_yahoo']."</option>\n";
}

Logged

smartbyte

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #17 on: May 10, 2010, 03:28:32 am »

If you are interested in how to make this plugin Cooliris compatible:

In codebase.php change the sequence of the RSS-feed in the Header on the album page(line 283): (move the $extra_header variable 2 lines up)
Code: [Select]
    $header .= "    $extra_header
    <link rel=\"alternate\" type=\"application/rss+xml\" title=\"".$CONFIG['gallery_name']." - RSS\" href=\"".$CONFIG['ecards_more_pic_target'].$xfd_feed."\" />
    <link rel=\"alternate\" type=\"application/atom+xml\" title=\"".$CONFIG['gallery_name']." - Atom\" href=\"".$CONFIG['ecards_more_pic_target'].$xfd_feed."&amp;type=atom\" />
    <style type=\"text/css\">

and in xfeed.php change the RSS stream to a media RSS stream(line 124):
Code: [Select]
//    print "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">";
    print "<rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss/\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n";
and comment out or delete the dc-creator line, because the media stream doesn't know how to handle dc tags:
Code: [Select]
//        print "\t\t<dc:creator>{$row['owner_name']}</dc:creator>\n";
and add the media tags (the creator from above is added again as media:credit):
Code: [Select]
        print "</description>\n";
        print "\t\t<guid>$base/displayimage.php?pid={$row['pid']}</guid>\n";
print "\t\t<media:credit role=\"uploader\" scheme=\"urn:yvs\">{$row['owner_name']}</media:credit>\n";
        print "\t\t<media:description>".htmlentities($title)."</media:description>\n";
        print "\t\t<media:thumbnail url=\"$base/".get_pic_url($row, 'thumb')."\"/>\n";
        print "\t\t<media:content url=\"$base/".get_pic_url($row, 'normal')."\"/>\n";
        print "\t</item>\n";

and voila Cooliris detects the pictures in the albums.

... just a suggestion, but it's a small change only and I think it's worth it!

C ya.
Logged

smartbyte

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #18 on: May 11, 2010, 03:13:33 am »



This is beta 2!

Now we still have the dc creator field, because I just added the xmlns:dc to the header.
... and the header looks like this:

Code: [Select]
    print "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\"";
    print "                     xmlns:media=\"http://search.yahoo.com/mrss/\"";
    print "                     xmlns:atom=\"http://www.w3.org/2005/Atom\">\n";

... and I have implemented the dc:creator flag again. Just to be sure, that it is as compatible as it gets...
(I don't know which software uses the dc:creator flags... but Aditya is the master of RSS, I just looked up and tested how to make them work with cooliris.)

By, bye.
Logged

ericco

  • Coppermine novice
  • *
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • Horlogerie-Suisse
Re: XFeed RSS/Atom feed plugin for CPG 1.5.x
« Reply #19 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
Pages: [1] 2 3 4 5   Go Up
 

Page created in 0.046 seconds with 19 queries.