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   Go Down

Author Topic: XFeeds RSS Plugin  (Read 66387 times)

0 Members and 1 Guest are viewing this topic.

lexx

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 6
XFeeds RSS Plugin
« on: November 23, 2008, 07:18:25 pm »

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.
« Last Edit: December 02, 2008, 09:21:21 pm by lexx »
Logged

lexx

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 6
Re: XFeeds RSS Plugin
« Reply #1 on: November 24, 2008, 08:22:53 pm »

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]
« Last Edit: November 25, 2008, 08:06:46 am by Joachim Müller »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: XFeeds RSS Plugin
« Reply #2 on: November 25, 2008, 08:01:19 am »

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".
« Last Edit: November 25, 2008, 08:10:00 am by Joachim Müller »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: XFeeds RSS Plugin
« Reply #3 on: November 25, 2008, 08:32:55 am »

The plugin looks very promising, so I decided to test it. The code generated inside the <head>-section of my testbed looks like this:
Code: [Select]
<!-- 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
Code: [Select]
<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 line
Code: [Select]
copy("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
Code: [Select]
<link rel="alternate" type="application/rss+xml" title="Coppermine Photo Gallery" href="http://localhost/~gaugau/cpg14x/xfeed.php" />should read
Code: [Select]
<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
Code: [Select]
<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
Logged

lexx

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 6
Re: XFeeds RSS Plugin
« Reply #4 on: November 26, 2008, 09:54:28 am »

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.
Logged

lexx

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 6
Re: XFeeds RSS Plugin
« Reply #5 on: November 29, 2008, 10:51:16 pm »

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.
« Last Edit: November 29, 2008, 11:11:07 pm by lexx »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: XFeeds RSS Plugin
« Reply #6 on: November 30, 2008, 09:30:23 am »

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
Logged

lexx

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 6
Re: XFeeds RSS Plugin
« Reply #7 on: December 02, 2008, 09:15:07 pm »

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;

Code: [Select]
<?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
« Last Edit: December 02, 2008, 10:03:37 pm by lexx »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: XFeeds RSS Plugin
« Reply #8 on: December 02, 2008, 11:29:36 pm »

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?
Logged

lexx

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 6
Re: XFeeds RSS Plugin
« Reply #9 on: December 03, 2008, 01:36:21 am »

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.
Logged

ff

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 108
Re: XFeeds RSS Plugin
« Reply #10 on: December 17, 2008, 07:56:42 pm »

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.
Logged

ff

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 108
Re: XFeeds RSS Plugin
« Reply #11 on: December 17, 2008, 07:59:40 pm »

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

tiziano

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 17
    • Chitarra Elettrica e Chitarra Acustica
Re: XFeeds RSS Plugin
« Reply #12 on: May 13, 2009, 06:24:34 am »

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
Logged
Tiziano

tiziano

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 17
    • Chitarra Elettrica e Chitarra Acustica
Re: XFeeds RSS Plugin
« Reply #13 on: June 03, 2009, 01:14:45 am »

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 ?

Logged
Tiziano

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: XFeeds RSS Plugin
« Reply #14 on: June 03, 2009, 08:57:22 am »

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.
Logged

tiziano

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 17
    • Chitarra Elettrica e Chitarra Acustica
Re: XFeeds RSS Plugin
« Reply #15 on: June 05, 2009, 09:56:51 am »

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
Logged
Tiziano

concreto

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • difusiones no comerciales
Re: XFeeds RSS Plugin
« Reply #16 on: June 12, 2009, 07:58:54 am »

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
Logged

concreto

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • difusiones no comerciales
Re: XFeeds RSS Plugin
« Reply #17 on: June 12, 2009, 08:05:05 am »

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...
Logged

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: XFeeds RSS Plugin
« Reply #18 on: July 10, 2009, 03:06:39 pm »

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.
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: XFeeds RSS Plugin
« Reply #19 on: August 14, 2009, 11:40:19 am »

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
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter
Pages: [1] 2   Go Up
 

Page created in 0.029 seconds with 20 queries.