• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

User Blogs System Widget

This entry is part of a series of entries "December 2016 - XenWord Development Log"
wordpress.jpg


A widget for showing the latest blog entry was added to XenWord 3.3 and is live on this site. This is the first row of the main loading page on the WordPress side. The CSS is not included in the xenword-public.css file and is very easy to add in the customizer CSS available in WordPress 4.7.

The key line is the use of the getBlogEntries method provided in the User Blogging System (UBS) XenForo addon.

PHP:
$conditions = array(
   'blog_entry_state' => 'visible',
);

$fetchOptions = array(
   'join'           => NFLJ_UBS_Model_BlogEntry::FETCH_BLOG
                       | NFLJ_UBS_Model_BlogEntry::FETCH_USER
                       | NFLJ_UBS_Model_BlogEntry::FETCH_SERIES_PART,
   'orderDirection' => 'DESC',
   'limit'          => 1
);

/** @var  $blogEntryModel NFLJ_UBS_Model_BlogEntry */
$blogEntryModel = XenForo_Model::create( 'NFLJ_UBS_Model_BlogEntry' );
$blogEntries    = $blogEntryModel->getBlogEntries( $conditions, $fetchOptions );

$preparedBlogEntries = $blogEntryModel->prepareBlogEntries( $blogEntries, false );
Next entry in series Latest threads in a wide view
Previous entry in series Featured Thread and Forum Widgets
  • Like
Reactions: robru

Latest reviews

Looking forward to using this in the near future. You have done a wonderful job creating widgets for Bob's addons.
As the XF ecosystem grows the demand for such widgets will follow.

Once again a great widget to have for any website! Keep them coming.
  • Like
Reactions: LPH

Blog entry information

Author
LPH
Views
1,894
Reviews
1
Last update
Rating
5.00 star(s) 1 ratings

More entries in Technology

More entries from LPH

Top