forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: lexx on November 23, 2008, 07:18:25 pm

Title: XFeeds RSS Plugin
Post by: lexx 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,

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.
Title: Re: XFeeds RSS Plugin
Post by: lexx 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]
Title: Re: XFeeds RSS Plugin
Post by: Joachim Müller 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".
Title: Re: XFeeds RSS Plugin
Post by: Joachim Müller 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
Title: Re: XFeeds RSS Plugin
Post by: lexx 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.
Title: Re: XFeeds RSS Plugin
Post by: lexx 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.
Title: Re: XFeeds RSS Plugin
Post by: Joachim Müller on November 30, 2008, 09:30:23 am
Wow,
I'm really impressed. Excellent work.
However, there are some issues with the plugin:
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
Title: Re: XFeeds RSS Plugin
Post by: lexx 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
Title: Re: XFeeds RSS Plugin
Post by: Joachim Müller 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?
Title: Re: XFeeds RSS Plugin
Post by: lexx 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.
Title: Re: XFeeds RSS Plugin
Post by: ff 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.
Title: Re: XFeeds RSS Plugin
Post by: ff on December 17, 2008, 07:59:40 pm
Sorry, didn't notice the xfeeds-button in the admin-menu.
Title: Re: XFeeds RSS Plugin
Post by: tiziano 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 (http://www.dodicesimotasto.it/dodecaphoto)
Title: Re: XFeeds RSS Plugin
Post by: tiziano 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 (http://www.dodicesimotasto.it/dodecaphoto/plugins/xfeed/xfeed.php) please could you help me ?

Title: Re: XFeeds RSS Plugin
Post by: Joachim Müller 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.
Title: Re: XFeeds RSS Plugin
Post by: tiziano 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
Title: Re: XFeeds RSS Plugin
Post by: concreto 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
Title: Re: XFeeds RSS Plugin
Post by: concreto 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...
Title: Re: XFeeds RSS Plugin
Post by: Aditya Mooley 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.
Title: Re: XFeeds RSS Plugin
Post by: Aditya Mooley 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
Title: Re: XFeeds RSS Plugin
Post by: Willamandrey on October 11, 2009, 08:06:40 pm
Thanks, very nice job!

It's working great on my site:

http://portrait.myphotos.cc [Edit GauGau] Warning: link not worksafe [/Edit]
Title: Re: XFeeds RSS Plugin
Post by: technozeus on October 29, 2009, 04:45:05 pm
First thanks for your great job.
I've installed the plugin and it works perfectly.

I've 2 question:
- is it possible to modify the link when a Feed Option is selected to open the link in a new page?
- is it possible to move the RSS image from over the table of categories/album in another place in the page? For example in my site I would like to move the RSS image in the menù above.

Thanks for your help.
Title: Re: XFeeds RSS Plugin
Post by: technozeus on October 29, 2009, 04:49:02 pm
Sorry, my website:
http://www.ilfra.it/photo/index.php (http://www.ilfra.it/photo/index.php)
Title: Re: XFeeds RSS Plugin
Post by: etienne_sf on December 26, 2009, 01:16:40 pm
Hi,

  It would be nice if the up-to-date version was attached to the first message, instead of having to browse the messages to find the last one...

Etienne
Title: Re: XFeeds RSS Plugin
Post by: dwo on July 21, 2010, 10:38:12 pm
I still use 1.4.

Is it possible to get the last pictures of a certain category with this plugin?

How would I have to change the code? Or could anyone give me a hint at least?

Thank you very much.
Title: Re: XFeeds RSS Plugin
Post by: penneybjvega on March 08, 2011, 09:35:43 am
The xfeeds-button is in the admin-menu for anyone having problem with this.