![]() |
display last written blog article
Hi,
I want to display the last written blog article on the top of my forum. The information is in the template 'FORUMHOME' under: {vb:raw template_hook.forumhome_wgo_stats} but in there i get all the data I don't need also (number of blog, articles in the last 24h ). So I need to know where can I extract the exact data I need. Thanks :D |
That's a good question - took me a while to figure it out. :) But the code that sets the blog stats on the forum home page is in the plugin "Forum Home: Process Blog Stats" (in the "Product : vBulletin Blog" section under the Plugin Manager).
|
I found it , but how do I extract the last article tilte and who wrote it?
I tried : 1. vB_Template::preRegister('FORUMHOME',array( 'last_article' => $latestentry['blogtitle'] )); 2. $template_hook['last_article'] = $latestentry['blogtitle']; |
Here's the structure of $vbulletin->blogstats, with junk from my test server.
Code:
Array So you probably want something like: require_once(DIR . '/includes/blog_functions_shared.php'); Code:
if (is_array($vbulletin->blogstats) AND is_array($vbulletin->blogstats['lastentry'])) |
thanks kh99,
1. i think you have a mistake in the $title = $user = .. row (don't know why you did that). 2. I am trying to also get the user link to his profile I tried several ways (non worked ): $link = 'http://www.s-maof.com/members/' . urlencode( $userid. '-'. preg_replace("/ /","-",$user)); $userlink = '<a href="'. $link . '" \>' . $user . '</a>'; i'm sutre there is an easier way.. |
Quote:
Quote:
What I posted was just meant to be some examples of getting the info, some of which might be useful. If you're trying to make a link to the user, maybe this: Code:
$userlink = '<a href="' . fetch_seo_url('member', array('userid' => $userid, 'username' => $user)) . '"/>' . $username . '<a/>'; (Sorry for any typos - I haven't actually tried this code). |
thanks, kh99, it works,
but instead of the $username , you have to use $user according to this thread example. So the whole plug in looks like this, PHP Code:
|
All times are GMT. The time now is 05:26 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|