get_results('SELECT * FROM ' . $table_prefix . 'miniblog ' . $identifier_q . ' ' . $sortby_q . ' LIMIT ' . $limit_q); if($results) { $cnt = count($results); for($i = 0; $i < $cnt; $i++) { $results[$i]->blog = stripslashes($results[$i]->blog); $results[$i]->title = apply_filters('the_title', stripslashes($results[$i]->title)); $results[$i]->url = stripslashes($results[$i]->url); if($results[$i]->text) { if ($filter) $results[$i]->text = apply_filters('the_content', stripslashes($results[$i]->text)); else $results[$i]->text = stripslashes($results[$i]->text); } } } else { $results = array(); } return $results; } } /* Simple, beginner-friendly (not to mention smart) version of the above function */ if(!function_exists('miniblog_list_entries')) { function miniblog_list_entries($before = '
Welcome to Miniblog! Make sure you have the latest version, or it may not work with your version of WordPress.
Miniblog is a plugin for Wordpress 1.5+ (and maybe lower). It is:
Help on adding items to, editing, or deleting items from the database.
The Title is simply the title of the item you wish to post.
This field is designated as a URL for link blogging, but it can be used for any purpose, as it is not required to input a hyperlink.
This field may not seem self explanatory at first, but it's really just a way to organize one's postings. The default entry is "default," so if one never changed the field, all posts would fall under this one category.
An example use of this is to separate your link blog from your asides. For every link blog entry made, one would change this field to "link." For every aside entry made, one would change this field to "aside." This is done so that they can later be called separately in templates.
This field doesn't appear the first time you publish an entry. To get it, you must save the entry and edit it via the list. All it does is allow you to change the date or time of the post. The format is Year-Month-Day Hour:Minute:Second (military time).
This field is the content of the entry. It is passed through the_content's filters.
This section demonstrates how one can use the entries saved in their templates.
This function is a beginner friendly version of miniblog_return_entries(). It has default formatting that is changeable and tries to keep in cahoots with other WordPress list functions.
The function is designed to be smart. If you have no title or url, it displays the date. If you have a title and no URL, it displays the title with no link. If you have a URL and no title, it uses the date as the href title. If you have no entry text, it skips the between parameter and displays nothing as a description.
Parameters:
Options:
Examples:
<h2>Asides</h2>
<ul>
<?php miniblog_list_entries(); ?>
</ul>
This will output the latest 5 entries in a simple list that makes up of only the title and the text separated with a line break.
<h2>Asides</h2>
<ul>
miniblog_list_entries('<li><strong>', '</strong><blockquote>', '</blockquote></li>', 'aside', 10);
</ul>
This will output the latest 10 entries with the blog identifier of 'aside' and display them in a list that will resemble this:
Yahoo! Mail, likely in an attempt to compete with G-Mail, will increased their storage capacity to 1gb.
This function returns a set of entries into an array of arrays containing entry data.
Parameters:
Options:
The array for each entry contains an object that can be accessed by calling the following methods.
Examples:
<?php
$asides = miniblog_return_entries(5, 0, '', 'Title');
foreach($asides as $aside) { ?>
<li><?php _e($aside->title); ?><br /><?php _e($aside->text); ?></li>
<?php } ?>
This will output the latest 5 entries in a simple list that makes up of only the title and the text separated with a line break.
<?php
$news_array = miniblog_return_entries(15, 0, 'news', '_date');
if($news_array) {
foreach($news_array as $news) { ?>
<div class="post">
<h2>
<a href="<?php _e($news->url); ?>">
<?php _e($news->title); ?>
</a>
</h2>
<div class="meta">
Posted on <?php _e(date("F j, Y, g:i a", strtotime($news->date))); ?>
</div>
<div class="content">
<?php _e($news->text); ?>
</div>
</div>
<? }
}
?>
This will output the latest 15 entries with the string 'news' in their blog identifier field and outputs them in a format much like Wordpress's default output style.
This function returns a URL to an RSS feed specified by the parameters entered. The parameters are exactly the same as the parameters of miniblog_return_entries() with two note-worthy exceptions:
The two new fields can have the following template tags within them:
Examples:
<a href="<?php _e(miniblog_create_rss_url()); ?>">Miniblog RSS</a>
This example will simply display the latest 5 miniblog entries that you've posted with your site's title and description as the feed's description.
<h2>Asides</h2>
<ul>
<?php
$asides = miniblog_return_entries(5, 0, 'aside', '_Date');
foreach($asides as $aside) { ?>
<li>
<span><a href="<?php _e($aside->url); ?>"><?php _e($aside->title); ?></a></span>
<?php _e($aside->text); ?>
</li>
<?php } ?>
</ul>
<?php $feed_url = miniblog_create_rss_url(5, 0, 'aside', '_Date'); ?>
<p id="asidefeed">
<a href="<?php _e($feed_url); ?>">rss</a>
</p>
This example is what I use on my index page to show asides. Notice at the bottom how I use the miniblog_create_rss_url().
<a href="<?php _e(miniblog_create_rss_url(5, 0, 'aside', '_date', "%site_name%'s Asides", "%site_name% (%site_description%) has asides. These are them.")); ?>">Miniblog RSS</a>
This example will output an RSS feed link with the title of "nmyworld's asides" and a description of "nmyworld (Just another WordPress blog) has asides. These are them." Your blog will show different results (because your blog has different settings).
To remove the table from the database, do it manually or enter the string "Remove Thyself" (case sensitive) in the box below and press submit.
The Miniblog table has been deleted from the MySQL database. To finish uninstalling the plugin, deactivate it from the "Plugins" menu and delete the file from the plugins directory.
Post not found.
Unable to update entry.
Entry successfully updated
Unable to add entry.
Entry successfully added.
Unable to delete entry.
Entry successfully deleted.