WP-Sticky New Ideas

I was thinking of not using the wp_postmeta table to tell where a post is sticky or not. Instead, I will use a new table called wp_poststicky to denotes all posts sticky status. Whenever you create a new post, a new row will be created in the wp_poststicky table.

0 will denote normal posts
1 will denote sticky posts
2 will denote announcement post.

Now I need to explain what is the difference between sticky posts and announcements posts.

Currently sticky posts are posts which will appear at the top of the page, I will change that name to be called announcement posts instead.

Now sticky posts will be referred as posts that will only stay on top of all the posts which is posted on the same day as the sticky post. My command of English is not that good, hope you are understand what I mean with the following example:

Announcement
– Post 5 (Announcement Post)

29th March 2007
– Post 6
– Post 7
– Post 8

28th March 2007
– Post 4 (Sticky Post)
– Post 1
– Post 2
– Post 3

As you can see, Post 4 is a sticky post and it will stay on top of all posts that is posted on 28th March 2007 ONLY, posts that are posted after 28th March 2007 (eg. 29th March 2007) will still be on top of the sticky post that is posted on 28th March 2007.

But for Post 5, which is an announcement post, it will stay on top of all posts.

Think of it as a feature in forum softwares in which announcement will appear in all forums and sticky topics will only appear in a particular forum.

This feature will be in the final version of WP-Sticky 1.00. Other features planned for future versions include auto un-announce, auto un-sticky posts after a certain number of days of date.

*UPDATED* 3rd December 2007
Uncle Bubba wrote:
When you login and write/manage a post you’ll see “Post Sticky Status” down in the lower right hand corner. There are three options “Announcement”, “Sticky”, and “None”. Announcement makes a post always on top no matter what. Sticky keeps it at the top of that day’s posts. So, say you made 4 posts on Wednesday and made one sticky, the sticky one would stay on top of Wednesday’s posts. If you then make a post on Thursday it will appear on top of all of Wednesday’s posts but underneath the Announcement post.

1 Star2 Stars3 Stars4 Stars5 Stars (181 votes, average: 3.97 out of 5)

New WP_Widget Class In WordPress 2.8

In WordPress 2.8, there is a new WP_Widget class, which personally I like it very much as now the multi-instances of widgets is handled by WordPress, all you need to do is just to extends the WP_Widget class and overwrite 3 of the functions namely widgets(), update() and form();

Below is a sample code taken from my WP-Polls that displays Polls Widget. It is tested and it works perfectly. Hope it is useful for plugin authors.

 __('Put a poll that you have added in WP-Polls on your sidebar', 'wp-polls'));
		$this->WP_Widget('polls', __('Polls'), $widget_ops);
	}

	// Display Widget
	function widget($args, $instance) {
		extract($args);
		$title = esc_attr($instance['title']);
		$poll_id = intval($instance['poll_id']);
		$display_pollarchive = intval($instance['display_pollarchive']);
		echo $before_widget.$before_title.$title.$after_title;
		get_poll($poll_id);
		if($display_pollarchive) {
			display_polls_archive_link();
		}
		echo $after_widget;
	}

	// When Widget Control Form Is Posted
	function update($new_instance, $old_instance) {
		if (!isset($new_instance['submit'])) {
			return false;
		}
		$instance = $old_instance;
		$instance['title'] = strip_tags($new_instance['title']);
		$instance['poll_id'] = intval($new_instance['poll_id']);
		$instance['display_pollarchive'] = intval($new_instance['display_pollarchive']);
		return $instance;
	}

	// DIsplay Widget Control Form
	function form($instance) {
		global $wpdb;
		$instance = wp_parse_args((array) $instance, array('title' => __('Polls', 'wp-polls'), 'poll_id' => 0, 'display_pollarchive' => 1));
		$title = esc_attr($instance['title']);
		$poll_id = intval($instance['poll_id']);
		$display_pollarchive = intval($instance['display_pollarchive']);
?>


			
		


			
		


			
		


1 Star2 Stars3 Stars4 Stars5 Stars (174 votes, average: 3.97 out of 5)

WordPress 3.0.2

WordPress 3.0.2 is out and it is recommended for everyone to upgrade as it is a mandatory security update for all previous WordPress versions.

Fixes:

  • Fixed moderate security issue where a malicious Author-level user could gain further access to the site.
  • Remove pingback/trackback blogroll whitelisting feature as it can easily be abused.
  • [Fixed other issues]

Changelog: WordPress 3.0.2
Download: WordPress 3.0.2
Download: Modified files since WordPress 3.0.1

1 Star2 Stars3 Stars4 Stars5 Stars (133 votes, average: 3.97 out of 5)

WordPress 4.9 Released

WordPress 4.9 has been released.

What’s New

  • Customizer Workflow Improved
  • Coding Enhancements
  • Even More Widget Updates
  • Site Building Improvements
  • Customizer JS API Improvements
  • CodeMirror available for use in your themes and plugins
  • MediaElement.js upgraded to 4.2.6
  • Roles and Capabilities Improvements

Download: WordPress 4.9

1 Star2 Stars3 Stars4 Stars5 Stars (143 votes, average: 3.96 out of 5)

4 Plugins Updated & 1 New Plugin

I have released updates for 4 of my WordPress plugins namely, WP-Polls 2.13, WP-PostRatings 1.05, WP-Stats 2.06 and WP-UserOnline 2.06. These 4 plugins have been internationalized. You can now easily localize it by translating it into your own language by modifying the .po file that is inside the zip with PoEdit.

I have also release 1 new plugin called WP-Ban. It enables WordPress Admin to ban users by their IP or host name from visiting your WordPress site. When the banned users visit your WordPress Site, they will get a message which can be edited via WP-Admin -> Options -> Ban -> Ban Message.

WP-Ban 1.00
» Readme/Changelog
» Download
» Support Forum

WP-Polls 2.13
» Readme/Changelog
» Demo
» Download
» Support Forum

WP-PostRatings 1.05
» Readme/Changelog
» Demo
» Download
» Support Forum

WP-Stats 2.06
» Readme/Changelog
» Demo
» Download
» Support Forum

WP-Useronline 2.06
» Readme/Changelog
» Demo
» Download
» Support Forum

1 Star2 Stars3 Stars4 Stars5 Stars (92 votes, average: 3.96 out of 5)