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 ");
Okay this is very good. This blocks guest from seeing....Can you please advise for code to allow certain user groups to see. Sorry I do not know code but can apply your advice.
i have changed the code now with the "read more" instead of the "(more) and have put a little center & b to this - a change the text size of the discription - it looks really perfect now
perfect hack now its perfect for me and it looks really professional now
thx for your help
Glad you like it
Quote:
Originally Posted by iamspookysdaddy
Okay this is very good. This blocks guest from seeing....Can you please advise for code to allow certain user groups to see. Sorry I do not know code but can apply your advice.
Thank you this is a most important modifcation!
Installed and Nominated!:up:
Thanks for the nomination that's unexpected for such a small mod
For usergroups you'd do something like this:
PHP Code:
if(is_member_of($vbulletin->userinfo, 1, 2, 3)) {
Replace the guest code with that. 1, 2, 3 being the usergroup numbers. This should also work for secondary usergroups
Thanks for the nomination that's unexpected for such a small mod
For usergroups you'd do something like this:
PHP Code:
if(is_member_of($vbulletin->userinfo, 1, 2, 3)) {
Replace the guest code with that. 1, 2, 3 being the usergroup numbers. This should also work for secondary usergroups
The mod is important because the CMS lacks basic needed functionality. It needs to be able to show content for specific user groups without blocking the page and displaying a no permissions screen.
However now I can not get the users or guest to function and it just displays empty box. Not sure why. Can you confirm if you are able to display content or not for specific user groups or guest???
Yes I have tried changing to user group ideas and cannot get the guest to work either. Widget displays normally with content until I add the additonal code to display to certain groups and then the box is empty.
Yes I have tried changing to user group ideas and cannot get the guest to work either. Widget displays normally with content until I add the additonal code to display to certain groups and then the box is empty.
For those wondering I handled spooky' request privately. It seems that regardless of the conditional statement the widget block will display with blank content.
Usergroup viewing permissions for widgets seem like another obvious function that is lacking in the vbCMS.
Updated to 1.6
- 4.0.2 started inserting [ATTACH] into the text fields. Simply add: