
01-19-2010, 10:43 AM
|
 |
|
|
Join Date: May 2008
Location: Boston
Posts: 248
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by tazattitude
That's what I mean by
"I changed the section to one of my sections"
PHP Code:
// Set Your Section ID Here $section = '28'; // This is a live section on my website (id: 28). Permissions to view granted to all usergroups // Set The Number of Articles To Display $limit = '3';
$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.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 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)) 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);
$output .= "<div align='center'>";
if($image != '') { $output .= "<img src='" . $image . "' width='150px' height='150px' /><br />"; }
$output .= "<a href='content.php?" . $nodeid . "-" . $url . "'>" . $title . "</a><br />"; $output .= "<p>Publish Date: " . $date . "</p></br>"; $output .= "<p>" . $text . " <a href='content.php?" . $nodeid . "-" . $url . "'>(more)</a></p></div><br />";
|
And you are getting an error with this code?
Quote:
Originally Posted by tazattitude
You can do this by default...
Admin Panel
Widgets>>Create New Widget >>Choose "General Search" (also name your widget)
Then "save"
Then you need to configure. Choose "Article". Then choose the rest how many days and how many you want to show up.
|
This will show every section though. To show just the front page set $section = '1';
|