No Future Posts
Diese Plugin ändert den Post Status von "future" auf "publish".
Warum? Normalerweise werden Einträge, die in der Zukunft liegen von WordPress ausgefiltert. Das hat den Vorteil, dass man Beiträge schreiben kann, die automatisch erst zu einem gewählten späteren Zeitpunkt veröffentlicht werden. Nachteil des Ganzen ist aber, dass man keine Termine einblenden kann. Durch mein Plugin werden nun auch vordatierte Beiträge ganz normal angezeigt.
Ausnahmen (Status bleibt "future") können per Artikel oder per Kategorie angegeben werden.
Momentane Probleme:
- Die Post-Anzahl in der Kategorieliste ignoriert diese Manipulation da sie einen eigenen Filter nach post-datum benutzt. Aber die Zahlen kann man ja ausblenden.
- Um die Posts auch im Kalender(-Widget) anzuzeigen muss man an die Core-Dateien da auch hier eine eigene Abfrage benutzt wird. Siehe Patch unten.
Calendar Patch:
To show the future posts in the calendar widget too you have to edit wp-includes/general-template.php about row 1181 (WordPress 3.0.1).
Look for
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
AND YEAR(post_date) = '$thisyear'
AND post_type = 'post' AND post_status = 'publish'
AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);
and change to
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
AND YEAR(post_date) = '$thisyear'
AND post_type = 'post' AND post_status = 'publish' ", ARRAY_N);
No Future Posts 1.2.1
Contributors: Tom BraiderDonate link: www.unicef.org
Tags: posts, future, events
Requires at least: 2.0
Tested up to: 2.8
Stable tag: 1.2.1
Changes the post status from "future" to "publish".
Description
Changes the status of all posts from "future" to "publish".
So future posts will show in your blog like other posts.
I use it to show events. No calendar plugin is needed.
Exclude liste for posts and categories.
Installation
- unzip plugin directory into the
/wp-content/plugins/directory - activate the plugin through the
Pluginsmenu in WordPress - fill the exclude lists on options page
Frequently Asked Questions
Screenshots
Arbitrary section
Known Issues
- post counter in the category list ignores future posts because it is using the post_date
- plugin "Customizable Post Listings" must change because it is using it own sql-query
Changelog
1.2.1
- new translation: russian, thanks Marcis Gasuns www.fatcow.com
- new: uninstall function for wp 2.7
- new: exclude lists for posts and categories
- new: languages english, german
- first release
created by Readme Parser
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
AND YEAR(post_date) = '$thisyear'
AND post_type = 'post' AND post_status = 'publish'
AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);
FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
AND YEAR(post_date) = '$thisyear'
AND post_type = 'post' AND post_status = 'publish'
AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);
Just a question / upgrade : How can I have the future post in the calendar wiget too ? Because the DB update permit to see post content but the calendar only show past to present event.
Hi Mike,
I think the widget uses its own DB query to select the latest posts. Maybe the "post-date" that wasn't change by my plugin.
Very handy plug-in! I'm with Mike, though, and think if it could show the post in the calendar widget as well, that would just be spectacular. Any chance you'll be adding this feature?
Maybe.
I must see how the widget works. Maybe it is possible to change it by the plugin.
You can change the WP file general-template.php (see patch above) to show the future posts in the calender too.
Oh man, you're the greatest! Thanks so much for coming up with that so fast!
You rule.
I give my best.
Hey tom. Still loving the plug-in, but I had another idea for it I was wondering if you might be interested to try. I wish I knew anything about the coding of these plugins, but you seem pretty good at it!
Anyway, I was wondering if there would be a way to show future posts for some categories, but not others. So if say you want to show posts in the category "Events" from future dates, but posts from category "Reviews" would not show posts from future dates.
Also, in the same line of thinking, maybe there would be a way to show future posts on some Pages and not others.
Hopefully that makes sense, but you were so quick at getting the calendar patch figured out, I thought maybe you could work this one out too. I'm still new to WordPress, but it's growing on me!
Oh my goodness!
You wish to exclude categories? Ok, i will think about it.
But what do you mean with "to show future posts on some Pages and not others."? Do you want to keep some posts in future status? It's another exclude list, isn't it?
Yes, that's what I mean. Just another exclude list.
I'm interested to see what you can come up with!
hi. Thanks for plugin
perfect.
Regards
I have an event site and love this plugin but is there anyway to reverse it so that the dates/posts are in chronological order?
Hello tru,
the post order is made by wordpress not by the plugin. Maybe the "query-posts" tag can help you. Sorry, it's german.
TOM!
Still loving your plugin. I have another challenge for you, though:
I use your plugin for events that get posted to our site. It allows upcoming events to be viewed. What I'd like to do now, though, is make a list of posts in only our "Events" category that will list posts starting with the current date and into the future.
We can display the Events category just fine, but when it comes to listing, I can either do highest (farthest in the future) date and back, or lowest (starting with the farthest in the past). What I'm going for is a list that starts on the current date and displays Event posts into the future.
I've been picking through the codex for the last couple days trying to find how i can do this, but no luck. As best I can tell there should be an argument that would fit in our WP_Query("cat=11&showposts=10"); but searching the codex and asking around the WordPress forums has been no help so far.
So, if you know anything that might help, I'd be much obliged to you once again!
Thank you.
OK, for the first problem you can try Different Posts Per Page to change order an number of posts per category. Older posts at the top newer at the bottom.
The second problem ist to start "now". I don't know a solution. Maybay it's ok to show only one month e.g.
<a href=".../?cat=4&m=200901">Events January 2009</a>?Tom - Great looking plugin. To display list of both future and previous events in sidebar, could use this with your plugin:
http://webdemar.com/wordpress/display-future-posts-in-your-wordpress-theme/
I think the advantage of your plugin is that it will actually publish on single.php.
Hello!
I'm to translate your plugin in belorussian language. when You publish this? My email - mrilyuha@gmail.com. Please answer me!
I've receive your mails. Thanks for translation. Please be patient.
Hello!
I'm to translate your plugin to belorussian language. when You publish this? My email - mrilyuha@gmail.com. Please answer me!
See the comment above. Perhaps i will update this week.
[...] events. The user can set post dates into the future and they will still appear on the blog. › Visit plugin site › Share and [...]
[...] No Future Posts [...]
I am using wp 2.9.2. The plugin seems to be working however I am not sure how to adjust the general-template file in order to link to the calendar widget. The code in your example seems to have changed a bit since 2.6. Any thoughts?
Thanks for all your time in the creation of the plugin.
The code is on line 1077 now.
thank you so much
why don't u finish your plug in, problem mit kategories und ordnung
shade
I only change the post status from "future" to "publish". The WP-functions call the post data to sort and filter. So you have to patch the WP core files.
Ich habe noch das Problem, daß, wenn man auf den Link zu einem ehemals-future-post klickt, eine Fehlermeldung kommt (wohlm weil irgendwo noch vermerkt ist, daß es ein noch ausstehender post ist?) ....das wird man auch irgendwo im Core ändern müssen, oder?
Danke für dieses super-useful Plugin!! :D
Wie lautet denn die Fehlermeldung? Bei welchen Links?
Ich ändere mit dem Plugin ja nur den Status. Kann sein, dass WP das in neueren Versionen etwas anders handhabt. Gib mir mal mehr Details, dann schaue ich es mir nochmal an.
and what about wordpress 3.0? it look to not work with it yet. or which line I have to change in it?
The code you posted to show posts in the default calendar widget saved me countless hours while working on a client's site. Danke schön.
I hope one day see this feature present directly in WP .
about WP 3 : Working perfect on the 3.0.1, for the calendar's display, use general-template.php and patch like before @ the line n° 1181 .
LOVE LOVE LOVE THIS!!!
Using posts as future assignments and due dates for students - this is PERFECT!!!!