benharker Posted December 20, 2010 Posted December 20, 2010 Hi all, first post here. I've been working at putting together a free digital signage solution for the college I work at, Xibo is what I've gone with as it's free and pretty scaleable. I have a virtual linux server running on our back end that runs the Xibo service and a Wordpress install that authenticates through to our eDirectory backend, that all works just great! The idea is, to set up the cycle of screens, the groups, the templates & timings by myself - and then have them all drag news in via the wordpress RSS feeds. This way my staff shouldn't [!!] bother me every single day - all they have to do is post their news either via email or via the wordpress site itself. [to keep it as 'hands-off' as possible for all involved!] even THAT is working just fine - there is just ONE more thing that I need to hammer down before I can release this baby out of testing... the RSS feeds being published by wordpress are being cut short - by the looks of it, thanks to the 'content:encoded' tag. Has anyone attempted a similar setup using wordpress and xibo? and if so, how did you get around the length-of-RSS problem...? I attempted an initial test using posterous, but obviously this throws an externally-reachable blog into the mix, and I'd rather keep this on-site! ...really hope someone can help!! oh and, merry xmas all Benny.
benharker Posted December 21, 2010 Author Posted December 21, 2010 Hi all, i got it sorted in the end, so if anyone's been having any similar problems regarding xibo, wordpress, and rss, here's how I got it working... the problem originates from the wordpress install - head to your web root folder - in my case [under SLES] /srv/www/htdocs/ and copy a backup of all the wordpress files... cp -r * wordpress/ ~/Desktop/Backup/wordpress_bkp once that's done, you only need to edit one file in particular... vi /srv/www/htdocs/wordpress/wp-includes/feed-rss2.php it's a pretty short bit of php code that looks a little something like this... <?php if (get_option('rss_use_excerpt')) : ?> <?php else : ?> <?php if ( strlen( $post->post_content ) > 0 ) : ?> <?php else : ?> <?php endif; ?> <?php endif; ?> notice how the reference to contains the_content_feed? that's a slight hack, it places the entire post into the description/excerpt that Xibo asks for... Don't worry about the content:encoded chunk, you don't need to change it since you're only going to use the which already contains all the data. that's the bit I changed to get the RSS from wordpress displaying full feeds that just pipe themselves happily into Xibo... hope this might help someone out there! oh and always keep backups! 1
plexer Posted December 21, 2010 Posted December 21, 2010 Many thanks for posting your solution I think it's a great combination that you've come up with there so it's even easier for people to have control over certain aspects of the xibo content in this case the rss feeds Ben
benharker Posted February 9, 2011 Author Posted February 9, 2011 Thanks I might just have a go at this. do it mate! it'll be worth it when it's all up and running. would love to hear how you get on
skell Posted February 9, 2011 Posted February 9, 2011 We do the exact same thing here, and the crazy thing is THE STAFF ACTUALLY USE IT. Yes, its 100% true. We have two reception screens and 2 staffroom screens, all running from 2 wordpress installs. Works a treat, even if I do say so myself.
benharker Posted February 9, 2011 Author Posted February 9, 2011 We do the exact same thing here, and the crazy thing is THE STAFF ACTUALLY USE IT. Yes, its 100% true. We have two reception screens and 2 staffroom screens, all running from 2 wordpress installs. Works a treat, even if I do say so myself. awesome! nice to know i was barking up the right tree for once with my wordpress idea. currently we're allowing all staff to log in to the wordpress as contributors, heads of departments can then check spelling and publish the posts - the categories that staff post under define which xibo layout they're displayed on - ie: 1 screen in foyer, for ten minutes it's the music department 'channel', the next ten minutes it's the PE channel, and it just cycles through just one public facing screen as of yet, but there's hopefully a few more in the works for different departments xibo's a great bit of software and i'll happily recommend it to anyone in IT
skell Posted February 9, 2011 Posted February 9, 2011 Are you running any Windows servers? We intergrated it into our AD so they can use their domain creds. And yes, same way, categories define where it goes. Great minds eh!
benharker Posted February 9, 2011 Author Posted February 9, 2011 Are you running any Windows servers? We intergrated it into our AD so they can use their domain creds. And yes, same way, categories define where it goes. Great minds eh! similar - our back end is eDir/novell, so staff authenticate via an LDAP plugin on the wordpress install, letting the users log in with their existing creds was a make or break xibo itself is running from a virtual suse box unfortunately the clients have to be windows [had no luck with the 'nix client]... if it weren't for that i'd go for a totally linux setup...
BenB Posted July 12, 2011 Posted July 12, 2011 Hi Ben, Where do I place this code? Do I have to replace all the code in rss2.php with your new code? Regards, Ben Hi all, i got it sorted in the end, so if anyone's been having any similar problems regarding xibo, wordpress, and rss, here's how I got it working... the problem originates from the wordpress install - head to your web root folder - in my case [under SLES] /srv/www/htdocs/ and copy a backup of all the wordpress files... cp -r * wordpress/ ~/Desktop/Backup/wordpress_bkp once that's done, you only need to edit one file in particular... vi /srv/www/htdocs/wordpress/wp-includes/feed-rss2.php it's a pretty short bit of php code that looks a little something like this... <?php if (get_option('rss_use_excerpt')) : ?> <=!=[=C=D=A=T=A=[<?php the_content_feed('rss2') ?>]=]=> <?php else : ?> <=!=[=C=D=A=T=A=[<?php the_content_feed('rss2') ?>]=]=> <?php if ( strlen( $post->post_content ) > 0 ) : ?> <=!=[=C=D=A=T=A=[<?php the_content_feed('rss2') ?>]=]=> <?php else : ?> <=!=[=C=D=A=T=A=[<?php the_excerpt_rss() ?>]=]=> <?php endif; ?> <?php endif; ?> notice how the reference to contains the_content_feed? that's a slight hack, it places the entire post into the description/excerpt that Xibo asks for... Don't worry about the content:encoded chunk, you don't need to change it since you're only going to use the which already contains all the data. that's the bit I changed to get the RSS from wordpress displaying full feeds that just pipe themselves happily into Xibo... hope this might help someone out there! oh and always keep backups!
benharker Posted July 13, 2011 Author Posted July 13, 2011 Hey Ben, nice name dude! i'll have a look at the relevant php file at my end, it's been a long time since i've even looked at it! [in a good way - it's been happily running itself all year!!] will post up what i find
BenB Posted July 13, 2011 Posted July 13, 2011 Yeah Ben, name is cool! Looking forward tot your reply! We try to fill a full region in Xibo with a full rss message (title and description). But for now we only see a few lines of the message with a [...] sign at the end of the last line. Maybe you can help us? Hey Ben, nice name dude! i'll have a look at the relevant php file at my end, it's been a long time since i've even looked at it! [in a good way - it's been happily running itself all year!!] will post up what i find
benharker Posted July 13, 2011 Author Posted July 13, 2011 here's my current edited feed-rss2.php file all you have to do is check it against your own, or, copy/paste, add it into your wordpress install and replace your current one! *may not work on newer wordpress installs, if anyone wants to confirm this, that'd be awesome hope it helps, let me know how you get on! <?php /** * RSS2 Feed Template for displaying RSS2 Posts feed. * * @package WordPress */ header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true); $more = 1; echo ''; ?> xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" <?php do_action('rss2_ns'); ?> > <?php bloginfo_rss('name'); wp_title_rss(); ?> <?php bloginfo_rss('url') ?> <?php bloginfo_rss("description") ?> <?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?> <?php echo get_option('rss_language'); ?> <?php echo apply_filters( 'rss_update_period', 'hourly' ); ?> <?php echo apply_filters( 'rss_update_frequency', '1' ); ?> <?php do_action('rss2_head'); ?> <?php while( have_posts()) : the_post(); ?> <?php the_title_rss() ?> <?php the_permalink_rss() ?> <?php comments_link_feed(); ?> <?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?> <?php the_author() ?> <?php the_category_rss() ?> <?php the_guid(); ?> <?php if (get_option('rss_use_excerpt')) : ?> <?php else : ?> <?php if ( strlen( $post->post_content ) > 0 ) : ?> <?php else : ?> <?php endif; ?> <?php endif; ?> <?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?> <?php echo get_comments_number(); ?> <?php rss_enclosure(); ?> <?php do_action('rss2_item'); ?> <?php endwhile; ?>
benharker Posted July 13, 2011 Author Posted July 13, 2011 BenB - above php code should definitely fix that problem, the file contains the small edit i made to get around that be aware that any wordpress updates you apply may write-over the fix, so keep a copy just in case
BenB Posted July 13, 2011 Posted July 13, 2011 Hi BenH. Do I agree you? If I make a file with the name feed-rss2.php with this code in it and put it in the right wordpress directory and execute it. Then it should be working? It doesn't do here? I'm sure I do something wrong. Can you help me? BenB - above php code should definitely fix that problem, the file contains the small edit i made to get around that be aware that any wordpress updates you apply may write-over the fix, so keep a copy just in case
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now