XFeeds RSS Plugin XFeeds RSS Plugin
 

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

XFeeds RSS Plugin

Started by lexx, November 23, 2008, 07:18:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lexx

demo: http://images.msiwind.net

This plugin integrates the xfeed.php file written by Mohammad Hafiz bin Ismail (mypapit) into to CPG and adds the required meta code so that search engines can find your feed and also a button that allows users to subscribe to you feed using various services.

This is the first coppermine plugin that I have written so if you have any advice or problems please post below.

features,

    RSS feed for coppermine.
    Adds a themeable subscribe button to coppermine
    Fully configurable through the Admin panel
    Has full support for feedburner (you can route all feeds throught feedburner to allow stats, etc)
    Has support for upto 5 custom urls on the dropdown menu

Installation:
Go to your config and enable plugins (if not already). Then open the plugin manager, upload the xfeed.zip file and click "i" to install, thats all there is too it.

Configuration:
To configure go to the Xfeeds button as admin.

Changelog:

New version (1.0 uploaded on 23/11/2008)
- Plugin created

New version (1.1 uploaded on 24/11/2008)
- fix: the head meta link to the feed was missing
- fix: problems with IE not showing the menu

New version (1.2 uploaded on 29/11/2008)
- The feed now resides in the plugin directory
- The feed directory has been renamed to xfeed rather than cpg-xfeed
- All included files are now licensed under GPL (Previously some components were CC3)
- custom links are now included under a sub-heading.

New version (1.3 uploaded on 2/12/2008)
- fix: owner_name used instead of admin email
- fix: gallery description now returned (was not global so wasn't displayed)
- fix: permissions now taken into account
- added atom feed
- added Feedburner included in head if set to route all through Feedburner
- cleaned up some silly if rules.

Looking forward to feed back and comments, Lee.

lexx

#1
Update; A few errors have been corrected in the following package. I don't have permission to edit the previous post so I have to make this one. The errors that were corrected are support for IE added (was broken) and the header code for the feed has been added, so please don't download the previous package. Please Download this one :
http://forum.coppermine-gallery.net/index.php?action=dlattach;topic=56622.0;attach=16489


Thanks.

[edit by PYAP][edit]

Joachim Müller

#2
Thanks for coming up with those fixes. Please don't hotlink to attachments - the URL might change later. I'm not sure though if it was you who edited the posting accordingly or wether this was done by Pascal. The correct explanation would be: "download the copy attached to this posting". You might want to come up with a naming scheme for your versions. I went ahead and changed the attachments in your postings to the correct naming scheme.
For future versions, you might as well consider using another folder name for your plugin: since the plugin needs to reside in coppermine's plugin folder anyway, there's no need to name it "cpg-xfeed". I suggest naming it just "xfeed".

Joachim Müller

The plugin looks very promising, so I decided to test it. The code generated inside the <head>-section of my testbed looks like this: <!-- Begin CPG XFeed Headcode -->
<link rel="alternate" type="application/rss+xml" title="Coppermine Photo Gallery" href="http://localhost/~gaugau/cpg14x/xfeed.php" />

<script type="text/javascript" src="plugins/cpg-xfeed/js/jquery.js"></script>

<script type="text/javascript" src="plugins/cpg-xfeed/js/feed_menu.js"></script>
<script type="text/javascript">
$ = jQuery;
</script>
<link rel="stylesheet" href="plugins/cpg-xfeed/css/feed_menu.css" type="text/css" />

<style>
.feed_menu{ background: url(plugins/cpg-xfeed/images/feed_menu_trans_dark.png) 0 center no-repeat;}
</style>
<!-- END CPG XFeed Headcode -->
All relative paths are correct, but the file xfeed.php doesn't reside where the script expects it<link rel="alternate" type="application/rss+xml" title="Coppermine Photo Gallery" href="http://localhost/~gaugau/cpg14x/xfeed.php" />. Apparently, the plugin tries to copy that file from the plugin folder to the root of the gallery during install, using the linecopy("plugins/cpg-xfeed/xfeed.php","xfeed.php"); in codebase.php, but this is not tested using the code. That copy operation fails, as my gallery root folder is not writable for the script (which is the recommended setup btw.). This being said, you'd need to implement a check that performs a lookup if the copy job was successfull and die with an error message if not. In my opinion it would be even better though if the file could stay where it is in the first place (without copying it around), so the line in the header<link rel="alternate" type="application/rss+xml" title="Coppermine Photo Gallery" href="http://localhost/~gaugau/cpg14x/xfeed.php" />should read<link rel="alternate" type="application/rss+xml" title="Coppermine Photo Gallery" href="http://localhost/~gaugau/cpg14x/plugins/cpg-xfeed/xfeed.php" />. This way, the plugin install won't fail on coppermine installs that have permissions set up as suggested in the docs. Another possible way to do as if a file existed in the coppermine root although it doesn't is the method to call it by parameter, so you could use<link rel="alternate" type="application/rss+xml" title="Coppermine Photo Gallery" href="http://localhost/~gaugau/cpg14x/index.php?file=cpg-xfeed/xfeed.php" />instead. I'm aware that this would require some additional fiddling with paths, but it would make things worth while, as I can see great potential in your plugin. In fact I'd love to ship it with cpg1.5.x out of the box. WHat license does the script come with? I'm aware that there is a license file in the plugin folder that says it's GNU GPL, but is this the case for all components used?

Regards

Joachim

lexx

Joachim, after tracking down the actual site/blog that originally posted the ajax menu, the feed_menu.js is licensed under CC3, as are the images for the ajax menu, which is a shame. There are other GPL alternatives to that jquery plugin (which I haven't had a chance to try yet). All other files are GPL. The other changes were not that much of a problem those i.e. keeping the xfeed.php file in the plugin's directory rather than moving it. Thanks for your comments.

lexx

#5
After a little work I've removed the creative commons 3 code and images from this plugin and the xfeed is now located in the plugins directory rather than the root directory of the gallery. The features remain largely the same.

Joachim Müller

Wow,
I'm really impressed. Excellent work.
However, there are some issues with the plugin:
  • as far as I can see, permissions are not being taken into account. Is that correct? If yes, could the output be pumped through the corresponding function in coppermine to make sure only the most recent uploads that are publicly visible are being displayed?
  • The <author>-tag is being populated with the email address instead of the user name. This will make email harvesters happy

On my wishlist I would add the textual content as well (title) and to see those textual fields go into different tags on the local feed.

Joachim

lexx

#7
Thanks for the feedback Joachim, I've fixed those issues, but I was looking into you suggestion of using coppermine's functions instead of doing separately. So I looked into how "lastup" works, so I could call the get_pic_data function with similar arguments. It worked but for some reason It's returning not following permissions, so I figure I'm missing something, here's what I have at the moment;


<?php
define
('IN_COPPERMINE'true);

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

function 
display_rss($album$cat$page$thumbs$display_tabs)
{
        global 
$CONFIG$AUTHORIZED;
        global 
$album_date_fmt$lang_display_thumbnails$lang_errors$lang_byte_units;

        
$thumb_per_page $thumbs;
        
$lower_limit = ($page-1) * $thumb_per_page;

        
$pic_data get_pic_data($album$thumb_count$album_name$lower_limit$thumb_per_page);

        
$total_pages ceil($thumb_count $thumb_per_page);

        
$i 0;
        if (
count($pic_data) > 0) {
                foreach (
$pic_data as $key => $row) {
                        
$i++;
                        
$pic_url =  get_pic_url($row'thumb');
echo "url:"."$pic_url<br />\n";
echo "owner:".$row['owner_name']."<br />\n";
echo "pic id:".$row['pid']."<br />\n";
echo "keywords:".$row['keywords']."<br />\n";
echo "description:".$row['caption']."<br />\n";
echo "ctime:".$row['ctime']."<br /><br />\n";
                }
} else {
                
theme_no_img_to_display($album_name);
        }
}

display_rss('lastup'1110false);
flush();
?>



it's similar to the display_thumbnails function. Any ideas?

Edit: missing $META_ALBUM_SET = $ALBUM_SET; works now

Joachim Müller

That's great news - I'll look into this after the feature freeze stage of cpg1.5.x, which will start next Sunday (I'm very busy doing the final features I want to see go into cpg1.5.x). Looking into your code I figured out that it will be a pretty straightforward task to make your plugin work with the upcoming release of cpg1.5.x. Do you allow us to bundle your plugin with the release of the cpg1.5.x package? Is your plugin GNU GPL compatible?

lexx

Cool, I'm looking forward to 1.5.x The plugin is definitely GNU GPL compatible, you can definately bundle it with the new release. I've attached an archive which has a few minor changes which make it compatible/validated with both the rss 2.0 and atom standards.

ff

Installed cpg1.4.x_plugin_xfeeds_v1.4.zip (with "$version='1.3';"  in configuration.php ;)).

I can't get into the feed options. Selecting the link "Feed options ->" doesn't give any response.

ff

Sorry, didn't notice the xfeeds-button in the admin-menu.

tiziano

I installed Coppermine 1.4 and the plugin XFeeds - RSS for Coppermine 1.4 but it doesn't work corerctly.

In Atom tehre is a fatal eror

In all the other choices it's impossible to get any information ...

look http://www.dodicesimotasto.it/dodecaphoto
Tiziano

tiziano

I still have the problem. Here the complete path to check it:http://www.dodicesimotasto.it/dodecaphoto/plugins/xfeed/xfeed.php please could you help me ?

Tiziano

Joachim Müller

Do as suggested in the error message you get (error 500) - ask the webmaster of the server for support. Tell them to let you have access to the server's error log to figure out what went wrong. An internal server error is exactly what the name suggests. We can't help you - we don't know what is wrong nor can we find it out for you.

tiziano

I will do then ... I thought it was a problem also for other people ... I will let you know what happens if my provider gives me the log ... thank you very much
Tiziano

concreto

HI

exellent plugin

could some one tellme where can i change the image color of the rss. for another one...

where is the file exactly...
i see in the file images various rss icon with diferent colors... iwould like to change the blue for the red.. but i dont know where i have to replace it
thanks
Mi galería en:    http://difusionesnocomerciales.tk/

concreto

excuse me i havent see the config tool in the panel admin... sorry... i just begin to look into the files and when i see only code y get confused...
Mi galería en:    http://difusionesnocomerciales.tk/

Aditya Mooley

Thanks for the great plugin. I am making it compatible with 1.5 and adding some more features like album RSS, category RSS, etc.
Will come up with a final working plugin soon.

Thanks once again.
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

Aditya Mooley

As promised, I have finished porting the plugin to 1.5 with some more features. Check out -> http://forum.coppermine-gallery.net/index.php/topic,61197.0.html
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter