The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||||
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:
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:
For Category Mod See Here: https://vborg.vbsupport.ru/showthread.php?t=232440 Screenshots
Show Your Support
|
3 благодарности(ей) от: | ||
case-dk, Oxylis, Toorak Times |
Comments |
#52
|
||||
|
||||
![]()
Kinda Vague problem there. Let me see your widget code and the HTML it outputs.
|
#53
|
|||
|
|||
![]() Quote:
// Set Your Section ID Here $section = '147'; // Set The Number of Articles To Display $limit = '2'; // 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 "); while($articleinfo = vB::$db->fetch_array($articlegrab)) { $title = $articleinfo['title']; $image = $articleinfo['previewimage']; $text = $articleinfo['previewtext']; $nodeid = $articleinfo['nodeid']; $url = $articleinfo['url']; $unixdate = $articleinfo['publishdate']; $date = date("F j, Y, g:i a", $unixdate); $fulltext = strip_bbcode($fulltext); $text = preg_replace('/\[ATTACH\=CONFIG\]\d\d\[\/ATTACH\]/', '', $text); $text = strip_bbcode($text); if($text == '') $text = substr($fulltext, 0,150); $output .= '<left>'; if($image != '') $output .= "<img src='".$image."' width='".$width."px' height='".$height."px' /><br />"; $output .= "<a href='content.php?".$nodeid."-".$url."'>".$title."</a><br /><p>Publish Date: ".$date."</p></br></center><p>".$text." <a href='content.php?".$nodeid."-".$url."'> <img alt='Read More' src='images/cms/read_more-right.png' title='Read More' border='0'></a></p><br />"; } |
#54
|
|||
|
|||
![]() Quote:
Thanks for your concern. I discover what's wrong with my widget. I tick the Permission Preview in the Display Content setting. After i remove the tick it's working now. :up: |
#55
|
|||
|
|||
![]()
Note that you can "easily" modify it to have the "best rated articles of this month"
1?) Add this in the SELECTed fields : Code:
, ".TABLE_PREFIX."cms_nodeinfo.ratingtotal Code:
AND (MONTH(FROM_UNIXTIME(".TABLE_PREFIX."cms_node.publishdate))=MONTH(NOW()) AND YEAR(FROM_UNIXTIME(".TABLE_PREFIX."cms_node.publishdate))=YEAR(NOW())) Code:
ORDER BY ".TABLE_PREFIX."cms_node.publishdate DESC LIMIT $limit Code:
ORDER BY ".TABLE_PREFIX."cms_nodeinfo.ratingtotal DESC LIMIT $limit Code:
$rating = $articleinfo['ratingtotal']; Code:
<span class=\"cmsrating rating{$rating}\"></span> |
#56
|
|||
|
|||
![]()
Thank you very much XManuX =) Will try it later.
Anyway to output the results in real time? Or at least weekly? What about modify it to the most viewed articles? =) |
#57
|
|||
|
|||
![]()
Is there any way to make this not display the content of the article, just the title with a link?
|
#58
|
|||
|
|||
![]() Quote:
To display most viewed instead of most rated, replace this : Code:
, ".TABLE_PREFIX."cms_nodeinfo.ratingtotal Code:
, ".TABLE_PREFIX."cms_nodeinfo.viewcount Code:
ORDER BY ".TABLE_PREFIX."cms_nodeinfo.ratingtotal DESC LIMIT $limit Code:
ORDER BY ".TABLE_PREFIX."cms_nodeinfo.viewcount DESC LIMIT $limit Code:
$rating = $articleinfo['ratingtotal']; Code:
$views = $articleinfo['viewcount']; Code:
<span class=\"cmsrating rating{$rating}\"></span> Code:
Viewed $views times. |
#59
|
|||
|
|||
![]()
Worked perfectly, both modifications, thanks XManuX =)
|
#60
|
|||
|
|||
![]()
I'm trying to modify the:
// Set Your Section ID Here $section = '11'; so it recognizes the section where it is. Right now I have lots of latest, most popular and most viewed articles widgets for the various sections of my cms. Just one generic of each kind that could recognize the section where it is would make things a lot easier =) Any help ? =) |
#61
|
|||
|
|||
![]()
Thanks for this, very nice. I am interested in doing this as well. I have deleted some code and it is working well, but I hate sloppiness. So if you could show the correct way, I would also appreciate it.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|