updated Version to 1.0.0
1.0.0 (4.08.2011)- confirmed working with 4.1.5 on our testsite, changed jquery path to account for 4.1.5 and below (now using the file which is uploaded in the zip)
- minor changes in the database query code
- fixed a bug where articles did show up in the slider even though their publish date was in the future
@The Rocketeer
As promised a query which does select specific articles - and nothing else. Just search and replace the top part of the php-widget code with this (you need to keep the bottom part in).
Code:
// DEBUG MODUS !
$debug_modus = false;
if($debug_modus === false)
{
ob_start();
}
//nivo slider - uf - vb.org version
//set these values as you need them:
//your slider folder - has to be read and writeable
//folder where all slider files are saved
$slider_img_filepath = 'external/unitedforum/slider/';
//picture width and height !same as in the CSS FILE!
$maxwidth = 650;
$maxheight = 250;
//do you want images without previewimage to be shown? slider is using the fallback then
$show_articles_without_image = false;
//picture shown if your articles has no previewpicture
$fallback_img = $slider_img_filepath . 'uf_fallback_slider.png';
//hardcoded maximum is 20 - if you want more just ask
$number_of_articles_shown = 20;
//lengh in characters of the article descriptions
$description_length = 95;
//specific articles you want to show
//../content.php?r=222-... (hover the edit button r= xxx is the id you want)
$articleids = '(222, 219)';
//Debug Messages
if($debug_modus)
{
echo "<span style='color:red;'>DEBUG MODE is ON! </span><br />";
echo "slider_img_filepath: $slider_img_filepath <br />";
echo "width: $maxwidth height: $maxheight <br />";
echo "show_articles_without_image: $show_articles_without_image <br />";
echo "fallback_img: $fallback_img <br />";
echo "#img: $number_of_articles_shown <br />";
echo "description_length: $description_length <br />";
echo 'directory ' . DIR . '<br />';
}
$article_type = vb_Types::instance()->getContentTypeID("vBCms_Article");
$time = TIMENOW;
if(!extension_loaded('gd'))
{
echo '<span style="color:red">Error occurred:</span> Your System does not support the GD-Libary. Please install the GD-Libary.<br />';
}
$article_get = vB::$db->query_read('
SELECT
article.pagetext,
article.previewimage,
node.url,
node.publishdate,
node.parentnode,
parentnode.url AS parenturl,
thread.replycount,
info.title,
node.nodeid,
GROUP_CONCAT( category.category )
FROM
'.TABLE_PREFIX.'cms_article AS article INNER JOIN
'.TABLE_PREFIX.'cms_node AS node
ON (node.contentid = article.contentid AND node.contenttypeid = ' . vb::$db->sql_prepare($article_type) .') INNER JOIN
'.TABLE_PREFIX.'cms_nodeinfo AS info
ON info.nodeid = node.nodeid INNER JOIN
'.TABLE_PREFIX.'cms_node AS parentnode
ON parentnode.nodeid = node.parentnode LEFT JOIN
'.TABLE_PREFIX.'thread AS thread ON thread.threadid = info.associatedthreadid LEFT JOIN
'.TABLE_PREFIX.'cms_nodecategory AS nodecategory ON nodecategory.nodeid = node.nodeid LEFT JOIN
'.TABLE_PREFIX.'cms_category AS category ON nodecategory.categoryid = category.categoryid
WHERE
node.setpublish = 1 AND
node.publishdate < '. vb::$db->sql_prepare($time) .' AND
node.nodeid IN '. vb::$db->escape_string($articleids) . '
GROUP BY node.nodeid
ORDER BY node.publishdate
DESC LIMIT 20');
$database_articles = array();
then look for this part:
Code:
//specific articles you want to show
//../content.php?r=222-... (hover the edit button r= xxx is the id you want)
$articleids = '(222, 219)';
And include your ids!
syntax is $articleids = '(id, id2, id3, id4)';
Number of Articles is dynamic, just include up to 20 ids (i can up that limit if need be).