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.

Download bei WordPress

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 Braider
Donate 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

  1. unzip plugin directory into the /wp-content/plugins/ directory
  2. activate the plugin through the Plugins menu in WordPress
  3. fill the exclude lists on options page

Frequently Asked Questions


Need Help? Find Bug?


read and write comments on plugin page

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
1.2
  • new: uninstall function for wp 2.7
1.1
  • new: exclude lists for posts and categories
  • new: languages english, german
1.0
  • 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);

RSS-Feed 33 Kommentare

alle Kommentare anzeigen / show all comments
  1. ly ly sagt:

    why don't u finish your plug in, problem mit kategories und ordnung
    shade :traurig:

  2. nenya nenya sagt:

    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

    • Tom Tom sagt:

      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.

  3. bagni bagni sagt:

    and what about wordpress 3.0? it look to not work with it yet. or which line I have to change in it?

  4. Chris Ellisom Chris Ellisom sagt:

    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.

  5. mike mike sagt:

    :thumbsup: Thanks a lot for this simple but so useful for event's blog.
    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 .

  6. Jennifer Jennifer sagt:

    LOVE LOVE LOVE THIS!!!

    Using posts as future assignments and due dates for students - this is PERFECT!!!!

Kommentare Seite:«123
alle Kommentare anzeigen / show all comments

Kommentar schreiben




Tiny Corner