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);
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!!!!