The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Recent article widget help
Hello.
I am unable to locate on forum but I guess it already answered somewhere.. I need a recent article widget for CMS which shows only recent article link.. no description etc.. And image beside article would be best.. |
#2
|
||||
|
||||
Hello I can help with that, try code below, create new php widget.
// Set Your Section ID Here $section = '120'; // Set The Number of Articles To Display $limit = '5'; // Set The Height of The Thumbnail Image $height = '100'; // Set The Width of The Thumbnail Image $width = '100'; $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.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.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 "); $output.="<table>"; while($articleinfo = vB::$db->fetch_array($articlegrab)) { $title = $articleinfo['title']; $image = $articleinfo['previewimage']; $nodeid = $articleinfo['nodeid']; $url = $articleinfo['url']; $fulltext = strip_bbcode($fulltext); $text = preg_replace('/\[ATTACH\=CONFIG\]\d\d\[\/ATTACH\]/', '', $text); $text = strip_bbcode($text); if($text == '') $text = substr($fulltext, 0,150); if($image != '') $output .= "<tr><td><img src='".$image."' width='".$width."px' align='left' height='75' HSPACE='5' VSPACE='3'/></td>"; $output .= "<td><b><a href='content.php?".$nodeid."-".$url."' align='top'>".$title."</a><p>".$text." </b></p><br/></td></tr>"; } $output.="</table>"; |
Благодарность от: | ||
MScotti |
#3
|
|||
|
|||
I guess it is to get article from a particular section, what about getting articles from all section?
|
#4
|
||||
|
||||
just add each section no you want seperated by a comma
|
#5
|
|||
|
|||
Thanks so much Mark4865, but if I want the same result with "Recent Blog Posts"?
|
#6
|
|||
|
|||
the link doesn't work with vbseo installed.
Is it also possible to show the preview text for the article? The code show only the images and the title of the article... |
#7
|
|||
|
|||
anybody can help me?
|
#8
|
|||
|
|||
Quote:
Regards, Mscotti |
#9
|
|||
|
|||
I love this widget, but I have a question, how would you make the Article title appear below each Image and have the images run horizontally, rather than vertically?
So they appear like this: I've been wanting to add this for ages, but can't get it to display quite right! Thanks so much for any assistance :-) |
#10
|
|||
|
|||
Quote:
Somebody will help? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|