Version: 1.6, by OcR Envy
Developer Last Online: Nov 2023
Category: vBulletin CMS Widgets -
Version: 4.0.0
Rating:
Released: 01-06-2010
Last Update: Never
Installs: 65
Auto-Templates
Re-useable Code Translations
No support by the author.
Latest Articles In Section
What is does:
vBCMS only has one option for latest articles and that is all sections and categories. This widget will allow you to display the latest articles in a specific section.
Change Log: 1.0 - Initial Release
1.1 - Updated to allow more than one section & display published date.
1.2 - Small update, no need to update unless you are using a table prefix.
1.3 - Added full page text if no previewtext row exists.
1.4 - Updated to not show unpublished articles.
1.5 - Updated read more link to look more vBulletin related.
1.6 - Small change to fix 4.0.2 [ATTACH] showing in text.
Installation:
Goto AdminCP-vBullietin CMS-Widgets->Create New Widget
Choose PHP Direct Execution as Widget's Type
Enter A Title IE: "Latest (Insert Your Section Name Here)"
Click Save
Click Configure
Remove all the default code.
Copy and Paste the code below first editing $section and $limit to your liking
Click Save
Goto AdminCP-vBullietin CMS-Layout Manager
Add the Widget to your Layout
Click Save
How do I find my section id? When clicking on your section you should see something like this:
The number after ? in this case 11 is your section id.
Can I enter more than one section id? Yes simply change $section = '11' to something like $section='11, 12, 13'
Code to copy(make sure you change $section and $limit!)
PHP Code:
// Set Your Section ID Here $section = '11'; // Set The Number of Articles To Display $limit = '1'; // Set The Height of The Thumbnail Image $height = '250'; // Set The Width of The Thumbnail Image $width = '250';
$articlegrab = vB::$db->query_read(" SELECT ".TABLE_PREFIX."cms_nodeinfo.nodeid , ".TABLE_PREFIX."cms_nodeinfo.title , ".TABLE_PREFIX."cms_article.previewimage , ".TABLE_PREFIX."cms_article.previewtext , ".TABLE_PREFIX."cms_article.pagetext , ".TABLE_PREFIX."cms_article.contentid , ".TABLE_PREFIX."cms_node.nodeid , ".TABLE_PREFIX."cms_node.parentnode , ".TABLE_PREFIX."cms_node.contentid , ".TABLE_PREFIX."cms_node.url , ".TABLE_PREFIX."cms_node.publishdate , ".TABLE_PREFIX."cms_node.setpublish FROM ".TABLE_PREFIX."cms_article , ".TABLE_PREFIX."cms_nodeinfo , ".TABLE_PREFIX."cms_node WHERE (".TABLE_PREFIX."cms_nodeinfo.nodeid = ".TABLE_PREFIX."cms_node.nodeid) AND (".TABLE_PREFIX."cms_article.contentid = ".TABLE_PREFIX."cms_node.contentid) AND (".TABLE_PREFIX."cms_node.parentnode IN ($section)) AND (".TABLE_PREFIX."cms_node.setpublish != 0) ORDER BY ".TABLE_PREFIX."cms_node.publishdate DESC LIMIT $limit ");
Thanks for this great widget! I think I have found a bug: Also not published articles get catched up by the sql-query. This is not very good
Please check this ...
Thanks for this great widget! I think I have found a bug: Also not published articles get catched up by the sql-query. This is not very good
Please check this ...
Hrmn ok thanks for the heads up I will look into it.
can this be modified to just show the latest article in each section? Right now it is show up double on my main page and I am looking to just have a different display for the newest article in each section.
can this be modified to just show the latest article in each section? Right now it is show up double on my main page and I am looking to just have a different display for the newest article in each section.
It's showing twice because you have the section set to your front page. I don't think it's possible to hide the front page section from appearing on the front page.
Maybe bit a bit more clear exactly what you want to show and not show.
I am trying to make the latest article in each section and the latest article on the main page show up different. I would like for them to have a larger image and have more a presense on the page than the typical 1x2 column that VB provides.
I am trying to make the latest article in each section and the latest article on the main page show up different. I would like for them to have a larger image and have more a presense on the page than the typical 1x2 column that VB provides.
This mod won't do that for you sorry
The front page will always show your most recent articles there's no way to turn that off as far as I know. This mod is meant to show latest articles in a section outside of the front page. You should be playing with the layout manager and your templates to accomplish what you want.
Updated to 1.5 It will no longer display unpublished articles.
I like it very much, but I would like to put some div there to use some css in order to make some changes (like floating the img to the left and the text on the right).
1.) when i click on the "(more)" link in the widget - nothing is working i get nothing displayed ?! (i think the problem is with seo - how can i fix this in the widget in the rest of the cms everything is working with seo .. please help )
2.) how can i display the showed articels side by side in one row ?!
I like it very much, but I would like to put some div there to use some css in order to make some changes (like floating the img to the left and the text on the right).