The Nouse custom plugins
Just a short blog post this time.
Before, I’ve promised to release some of the custom plugins we use here at Nouse, and I’ve now gone and got the plugins listed on WordPress’s Extend directory for people to get.
We have 7 custom plugins and 13 standard plugins, and now 5 of those plugins will be available for you to use on your own blog if you want to. The other 2 custom plugins are very unlikely to see the light of the day, but are probably uninteresting (not that all the ones that are being released are interesting). They’re a ‘Media Charter Compliance’ plugin that sends YUSU an e-mail whenever a new news, sport or comment article is posted, and the second is our YSTV integration plugin.
However, the other 5 are available now from WordPress.org:
Our plugin to have images attached to articles and dynamically resize them on the backend.
A plugin that exports RSS feeds in a JSON form.
The Popular This Week widget.
A plugin that lets you have images associated with tags.
Our live blogging plugin. I made a screencast to demonstrate how to use this too.
So, short and sweet, but this is the giving back to the open-source community I talked about back in my first blog post.
Speaking of open source, the base of the fantasy football site has been available up to now, but wasn’t in any kind of source control management, so I’ve put it on github now for anyone interested:
http://github.com/aliclark/php-web-apps/tree/master
Still no docs yet, but I’ll try and write something up soon.
*Begins scanning Fantasy Football source for a way to hack his way to victory*
Chris Northwood,
Hello, Thank you for making your plug-ins available. I have a question for you about Live-Blogging. Do you think I would be able to run Meteor on andLinux http://andLinux.org ?
Thanks for your time.
Pablo
I’m not completely familiar with it, but it seems so – as long as you can run Perl applications and accept incoming connections, yes. The best place to get Meteor support is on Meteor’s discussion group at http://groups-beta.google.com/group/meteorserver however.
Hi Chris – love the live blogging plugin. I’m no techy so excuse my ignorance but my developers are asking (as we run Apache) whether Apache can handle the dynamic blog posting?
Cheers,
Justyn.
Hi Justyn,
The dynamic blog posting system is a separate server to Apache, the plugin basically links WordPress with the Meteor software to provide that functionality.
When we used it, the setup was such that we had the blog served by Apache as usual, and then Meteor Server running separately.
Hope that helps.
Hi Chris!
I am very excited to use your plugin for live sports coverage…and I am embarrassed to ask a couple of dumb questions. One – the post is not auto updating. I still have to refresh…have I done something wrong? And two – what is Meteor? Is this why it doesnn’t auto-refresh?
Thanks for your help!
Hi Jessica – yes, Meteor will be the reason your auto updating isn’t working!
Basically, for this type of thing you need a special type of web server in addition to your normal web server – this is called a Push or Comet web server, which Meteor is – so you must have Meteor running as well as your normal website, and then the plugin simply uses this special Meteor server to provide web pages without refreshing – a normal web site can not handle it, which is why the special Meteor server is needed.
Hello.
We have set up Meteor and would like to use it (without Twitter) in combination with your live-blogging plugin.
We have filled in the configuration screen thus:
Meteor Subscriber Host 127.0.0.1
Meteor Controller Host 127.0.0.1
Meteor Controller Port 4670
Unique ID to use for Meteor
Note: Unique ID is blank as we didn’t know what to put in this field.
However, our WordPress admin cannot make the blogs whizz in without refreshing the screen so I guess we’ve done something wrong.
If you could shed any light on what our problem could be it would be most helpful.
Thanks.
Hi Dan,
You can enter anything you like in the unique ID box. It probably does need to be set though. It’s so you can run multiple blogs from the same Meteor server without any clashes occuring.
If you set Meteor subscriber host to 127.0.0.1, then that means that only people on the same machine as the server can access it. You need to set it to the external address of the Meteor server. Note it must be run on port 80, and must fulfill the XSS restrictions of whatever browser you’re using: http://meteorserver.org/faq/
Chris
Chris,
Just came across your plugin and I have a few questions.
First, is there anyway I can change the formatting of the live blog post? I dug around the plugin a bit (albeit from my phone) and I cannot seem to find any css or formatting within the script unless I missed it. I am looking to change the format and font of the timestamp.
Secondly, I wish to swap to a top down format and reduce the linebreaks between the posts.
I know these are personal preferences, but I figured I would at least ask.
Thanks,
Michael Schuerlein
http://www.islesblogger.com
Re: the JSON plugin..
If I have the permalinks set, my site is http://siteurl/feed. How would I include that with the code you specify, “?feed=json” ?
Thanks!
Michael:
I feel I must apologise – the plugin was coded very quickly and although I keep meaning to make a lot of improvements to it, other commitments (particularly my University work) come first. The design of the live blog isn’t configurable in the present version – this is something I hope to correct in the future, but at the moment the only way to do it is to directly edit the file itself.
Steven:
This can be done simply by appending the code to the end. e.g., http://siteurl/feed/?feed=json. This can be done to any of the feeds on the site to get a JSON version of it.
Chris,
I think I narrowed down where to make edits in the files, but have not found where to make it go top down just yet.
No need to appologize, I am used to tweaking to get what I want!
Anything I should know before I go making big edits?
Well there are actually 2 places to edit: once in the PHP file, and again in the JavaScript. As for making it go top-down, then again, there’ll be two places to edit it, once in the liveblog_static, changing the DESC to an ASC in the SQL query, and again in the JavaScript, changing the prepend to an append for inserting the new post.
Chris.
We have got the Live-Blogging plugin talking to Meteor and the status screen confirms this. However, when we add a live blog it doesn’t appear unless we refresh the screen. The reason for this seems to be that (according to Firebug) the plugin is looking for JQuery in liveblog.js, which it cannot find.
Can you suggest what the resolution to this might be please? How would I include JQuery?
Thanks.
Okay, that does seem to be a bug. Basically, in order to sort this out, you need to add
wp_enqueue_script("jquery");to your functions.php for your theme. I’ll hopefully get this fixed when I have some time.
Thanks Chris.
That’s all working fine now.
Hi Chris – we have the live blogging plugin working great in development, but the lines that separate the posts are running into the right hand column on our wordpress blog. Is there a way we can shorten the length of the lines or do we need to change our blog template settings?
Thanks,
Justyn.
Hi Justyn,
I’m afraid that modifying the template that the live blog uses is a feature I’m yet to add. To alter how the live blogging plugin displays its outputs, you must edit the file directly – line 378 of live-blogging.php and line 12 of liveblog.js are the appropriate places to edit to update the theme displayed.
Chris
Thanks Chris – we’ll have a go.
Cheers,
Justyn.
Hi Chris,
im interested to use your plugin for our pokerevent livecovergae next time. First of this, we need some changes for better working. We hope that you find time to help us. You can have al look to actual version:
http://blog.royalflush.de/category/rflive/
1. the first Entry we made and change later, stays at the top and not at the end of the liveblog. By any change the date is not set correctly by updating entrys
2. How can we activate our normal wysiwyg editor in the new entry site to have some more options
3. is it possible to insert some code that the site will refresh automaticly by any user after new entry
4. How can we add the autor of the entry beside the date. it could be look so:
Autor: XXXX Time: YYYY
5. If the liveblog is very long, how can we change to a “next site”?
These are the most importend features we need. Hope to hear from you
Roy
Hi Roy,
I’m not sure I understand your problem with the 1st issue. The first entry in the liveblog always stays at the end in my test set up. Perhaps you’re confusing the standard New Entry screen with the liveblog one, in which case anything in the new entry screen will appear in it’s appropriate place in the entry.
2. I don’t think you can at the moment, I’m unsure on what the issue is (we use WordPress’s default the_editor() function)
3. Yes. This is the only reason for this plugin to exist. In fact, it’s built-in functionality that you can’t turn off. The only reason it won’t work is if you haven’t set up a Meteor server and not installed the plugin correctly.
4. Alter the plugin code.
5. Create multiple liveblogs, each one on its own article/page/whatever.
Hi Chris,
ty for fast reply. If you have a look to the link you can see problem 1. The firste entry from 15.23 stays on top, but its older then the other ones.
15.23
Livecoverage aus dem Westspiel Casino Hohensyburg ab 4.Mai 2010.
18.19
8. testeintrag
18.16
7. Testeintrag
2. We use the the tiny MCE, so could it work if we change in code from the_editor()to wp_tiny_mce()?
3. yes, i dont set off an meteor. Do the blog not work without meteor?
4. Can you show me the parts/lines/files inside the code for adding this?
Thanks Roy
…. i changed now the entry 3 and dont change time. after publishing, the time is the new and the post goes up.
Roy
Roy:
1. I don’t know why that would be the case. Are they from different dates?
2. Maybe. I just assumed the_editor() did all that stuff magically.
3. Meteor is needed for the auto-refreshing stuff.
4. line 378 of live-blogging.php and line 12 of liveblog.js are where the styles are defined.
1. I don’t know why that would be the case. Are they from different dates?
No, only few minutes betwenn entry and change entry
2. Maybe. I just assumed the_editor() did all that stuff magically.
I will test it. The Editor that now load is very simple. no format, no other!
3. Meteor is needed for the auto-refreshing stuff.
OK, i will see how i can install on our server
4. line 378 of live-blogging.php and line 12 of liveblog.js are where the styles are defined.
in js file i only find the style informations in line 12:
#”;
in php file could be the right one, but im not good in php to add “author” entry. i think it must be before:
‘ . mysql2date(‘H.i’, $entry->dt) . ‘ call for time?
$output .= ‘entryid . ‘”>‘ . mysql2date(‘H.i’, $entry->dt) . ‘‘ . apply_filters(‘the_content’,$entry->post) . ”;
KR Roy
I Found this in an Thread:
Althought I had to add some lines to the initialization (probably depending on the plug-ins activated).
Here’s what I am using:
add_filter(‘admin_head’,'myplugin_tinymce’);
function myplugin_tinymce()
{
wp_enqueue_script(‘common’);
wp_enqueue_script(‘jquery-color’);
wp_admin_css(‘thickbox’);
wp_print_scripts(‘post’);
wp_print_scripts(‘media-upload’);
wp_print_scripts(‘jquery’);
wp_print_scripts(‘jquery-ui-core’);
wp_print_scripts(‘jquery-ui-tabs’);
wp_print_scripts(‘tiny_mce’);
wp_print_scripts(‘editor’);
wp_print_scripts(‘editor-functions’);
add_thickbox();
wp_tiny_mce();
wp_admin_css();
wp_enqueue_script(‘utils’);
do_action(“admin_print_styles-post-php”);
do_action(‘admin_print_styles’);
remove_all_filters(‘mce_external_plugins’);
}
Maybe it’s possible to tweak it a bit. And the HTML:
<div id="” class=”postarea”><?php the_editor("hello world strong!“); ?>
Ok, i found the reason for my wysiwyg editor. Tiny now work in new post and edit post.
Now only i need help with the time problem when edit ab post.
Thanks roy
Hi,
no help? thats sick;-(
I cant find the reason for the 2h differenz when i edit an post.
Roy
Yeah, sorry, I’ve no idea what’s causing your problems.
Lol, if you have no idea.. where else?
Is it possible that you can test this on your server?:
Post an new Entry with normal time
Load this entry to your dashboard to edit (korrekt time is displayd)
change something in Text, let time stay on original and click post
Now the post goes up with 2h later. If you edit again, annother 2h will add to the posting time.
it must be an bug in php script or something, but i dont know where.
Roy
It works perfectly on my test blog.
Ok, there are dierent files you use? i test this on 2 different wordpress installations. allways the same!
Can you send me your files that works for test?
I install the plugin over wordpress installations.
Also i can give you a login to my test blog to see the probs.
Can you please delete this after connect?
Tanks Roy
Yes, I’m using the exact same code as is released on the Extend directory. I suspect you start looking at timezone configurations on your server and WordPress installations, as it sounds like something there is broken. The code itself is agnostic to timezones, and I’ve successfully had it work in non-GMT timezones, so I don’t believe the issue is related to that.
I don’t really have the time or desire to debug your specific setup I’m afraid.
Ok, i understand. I have to search on other place..
I find the timezone cant be the problem, because the new post allways show the right time.
The Problem only when i edit an older Post.
Thanks again for your time..
Roy
If your timezone is +2 (as it would be in Germany) it seems as if it is constantly adding 2 to your times upon every edit. Which makes no sense, and definitely isn’t part of the code. When you edit an entry, is the time at the bottom set to be correct? Perhaps it needs to be UTC or something?
My timezone is Berlin in WordPress. When i add a new post the correct time is show. When i load this entry to edit the post in my dashboard, the right time is showing under the content!!!! i dont change the time there, and press “post”… the post will be come on site with +2h.
Very interesting: When i will change this post again, i load it to edit post and change content, time under the post will be the newer time with +2h, now the time goes again plus 2h!
Thats the point i think there must be any error in editpost.php!
http://steffis-aquarelle.de/?p=140
here you see the 2. testsite.
Roy
It doesn’t happen on either my blogs, or any of the other blogs I’ve tested. It’s not edit_entry.php, that does absolutely no time conversion whatsoever. The only time conversion is done by MySQL and PHP. That must mean your MySQL and PHP have different timezones and conversion between the two is getting confused.
Ok, could be. But why news post gets right time?
the only reason i think will be to block any time changes when edit an post. do you know which code i must deactivate to do that?
Roy
Sure, alter the SQL UPDATE query so times don’t get changed (in live-blogging.php, the liveblog_edit_entry function, or something like that).
Hmm, should i delete this line complete?
$query = $wpdb->prepare(“UPDATE `{$table_prefix}liveblog_entries` SET `post`=%s, `dt`=FROM_UNIXTIME(%d) WHERE `entryid`=%d”, $new, $dt, $eid);
Roy
Only if you want to remove the ability to edit posts at all.
$query = $wpdb->prepare(“UPDATE `{$table_prefix}liveblog_entries` SET `post`=%s WHERE `entryid`=%d”, $new, $eid);should do the job
Yeahhhh, it works!!!!
Thats all i need!! Thank you very much!!!!!
greatings from germany!!
Roy
Hi there
We’re looking at using Live-Blogging for obvious applications, but we have no idea where to begin with Meteor.
Are you please able to do a post detailing how to install Meteor?
Thanks very much
Kenneth
Hi Kenneth, I found the installation guide provided with Meteor pretty suitable – download the file, open it, get a spare IP assigned to your server that Apache isn’t bound to, set up DNS to point to that IP, configure Meteor to bind to that IP, start Meteor, tada.
What issues are you having in particular? tbh, I’m not a Meteor expert, you’d perhaps be best off using the Meteor support forums.
Would it be possible to achieve the same effect as the Meteor server with a meta refresh tag?
Not the exact same effect, no – the entire page will be reloaded, so you won’t stay in the same position, any comments being written whilst the page is reloaded are lost, etc – plus, that puts more load on the server
Cool, well, awesome plugin anyway.
Chris
Hi Chris,
one more question. Is it possible to delete some older liveblogs?
KR Roy
No, but you can delete the posts they appear in so they no longer appear on the site
Hi Chris,
a last question. I also use the Share Button Plugin for sharing content with facebook and other. Now any entry in Liveblog will have the share Button, that dont look good for us.
I find this code inside your php:
// We don’t want sociable appended after every thing
if (function_exists(‘sociable_display_hook’))
{
remove_filter(‘the_content’, ‘sociable_display_hook’);
}
do_action(‘liveblog_add_entry’, array(‘lbid’ => $lbid, ‘entryid’ => $wpdb->insert_id, ‘dt’ => date(‘H.i’, $dt), ‘entry’ => apply_filters(‘the_content’,$entry)));
if (function_exists(‘sociable_display_hook’))
{
add_filter(‘the_content’, ‘sociable_display_hook’);
}
How can i change this to remove the entries from my share plugin.
Here the link to the plugin:
http://phat-reaction.com/share-and-follow/
Thanks Roy
It depends on the code of the exact plugin. Basically, search for the name of the function that is hooked to display the share buttons, and replace sociable_display_hook with the name of that function.
Ok, i found this code, that i have to insert if i want to use the share buttons manuel:
Could it be that:
if (function_exists(’social_link($args)’))
{
add_filter(‘the_content’, ’social_link($args)’);
Roy
It would just be ‘social_link’, don’t include ($args)
Hmm, dont work. I found different Functions in the Plugin Code:
function the_share_links(){
function get_the_share_links()
//show social links function
function social_links($args){
But no entry o this will work. allways the share Buttons inside.
I think this could be right, but no way:
// We don’t want sociable appended after every thing
if (function_exists(‘social_links’))
{
remove_filter(‘the_content’, ‘social_links’);
}
do_action(‘liveblog_add_entry’, array(‘lbid’ => $lbid, ‘entryid’ => $wpdb->insert_id, ‘dt’ => date(‘H.i’, $dt), ‘entry’ => apply_filters(‘the_content’,$entry)));
if (function_exists(‘social_links’))
{
add_filter(‘the_content’, ‘social_links’);
}
Roy
I’ve no idea. I don’t know anything about that plugin I’m afraid, I don’t know how it hooks, etc, etc…
Ok, whitch plugin is it, that you filter inside with sociable_display_hook. So i will have a look to use this and kill the other share plugin?
Roy
Ok, i found it. Sociable works fine with your filter.
Thanks Roy
p.s. now only i search for intergrate Autor Name beside the Time in any liveblog entry.
Roy
Another Question Chris,
can the meteor running on a different server from website, or must be same Server?
Roy
It can run on a different server, as long as there’s a subdomain within the same domain pointing to it. There’s plenty in the Meteor documentation about this.
Ok, i set up an PC with ubuntu and running meteor on this. teh controller port is set to 80. I can see this in debug mode. Nothing else is running on this server.
I set in my config the IP for subscriber host and controler Host in Live Blogging Config to this server. In the field Port i put 80.
Live Blogging Status
OK
uptime: 88
channel_count: 0
total_inbound_bytes: 10
controller_connections_accepted: 1
current_controllers: 1
total_requests: 1
–EOT–
OK
If i edit new entry now, on the Server i see:
New Message 0 on Channel 5- liveblog-2
Will close Meteor::Controler for xx.xx.xx.xx when write buffer empty
Closed meteor:: Controler for xx.xx.xx.xx
But the site where the Blog will be showing, is loading not complete. It looks like waiting for data?
Did i configure some more? I cant find any help. Is ist possible to get an ready meteord.conf from you?
Danke Roy
p.s. hope yozu can help me, i have a big event next week!!
What is the host name of the server running Meteor, and the address of your live blog.
They must be on the same domain name, e.g., if your website is http://www.example.com, Meteor must be somewhere on the same domain name, e.g., meteor.example.com, or data.example.com, or something like that, otherwise you get XSS issues.
The error is almost certainly in JavaScript, not with Meteor. If you’re using a browser like Firefox, what does your error console give you?
actually, controller port can not be 80, obviously, as that’s the port your subscribers use. Your controller port must be something other than 80, and your subscriber port must be 80.
The IP adress of the blog is different then the ip of the meteor server. the Testblog is inside this post:
http://www.royalflush.de/2008/09/30/wsope-mainevent-tag-2-jan-schwarz-und-seine-geheimwaffe/
You can delete it later…
I cant install the meteor server on the same server where the blog is located.
Can you hav a look?
Roy
Hmm, how do i insert this in metord.conf?
Controler Port normaly is 4671. Can i use this?
Roy
You can not configure Meteor to point at an IP address due to XSS restrictions.
Basically, what you need to do:
1. Add an A record to your DNS to point data.royalflush.de to 81.210.137.182
2. Change your subscriber host to data.royalflush.de
once that has been done, and your controller ports set up correctly (I can’t remember how to do this), your liveblog should work.
If you’re still having issues, read the Meteor documentation. If you’re still having issues, I direct your attention towards the ‘Hire Me’ link at the top of the page.
Hi Chris,
it seems to work now. my last Question!!!!
Everytime i post new entry, i see the line between new post. I dont want that line. when i refresh the site, evereything is ok.
How can i deactivate the line betwenn posts for meteor complete?
Thanks again
Roy
I would guess you need to edit liveblog.js to change the line showing (if the issue is what I think it is).
With regards to your author question, I will be adding that to a future version of the live blogging software, which I should have time to do this summer.
Ok, sounds good. This Plugin is very hot i think. Some more options will be good.
One is to insert pictures. I insert nextgen galery with this code: [nggallery id=26]
But Meteor cant work with this. in Liveblog you only read this: [nggallery][id=25]
I dont know why he set ][ betwenn the text.
you can see this on the site with link i give you.
Roy
Neither do I, I’ve used other shorttags without issue. If you insert your picture normally (that is, using the built-in WordPress features) it should work.
yes, but only one pic, not an album or something. i will try other options. the normal galery option at insert pictures is not available at new entry admin site.
Roy
Ok, Chris.
I give up now. sorry, i cant find any reason for the time problems. I think i hav to wait for an update version from you.
The Meteor now running fine. Site refreshing and fading works fine. But there allways problems with time settings.
The new post come up and showing right time with meteor push. When i deactivate meteor connect and refresh the site, the time goes up with 2 Hours:
I dont understand this. I think the entry in WP DB will be with right time. But Meteor use different time settings.
I dont know.
Thanks Roy
Hope for news version soon.
Roy, I’ve tracked down the issue – it appears to occur in WordPress under particular circumstances (in particular CentOS’s PHP distribution) where WordPress corrupts the timezone. I’ve e-mailed you a beta fix for the software. Please let me know if it fixes the problem.
Hi chris,
i use your new files. Have a look to the Testsite:
http://www.royalflush.de/2008/09/30/wsope-mainevent-tag-2-jan-schwarz-und-seine-geheimwaffe/
Post and Edit seems to be OK. But if you refresh the site, Time goes down with 2h. Than Meteor pushes again the correct time.
If deactivate meteor now, time is not the same like the post.
Hope you can see this
Thanks Roy