vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - United-Forum Nivo Slider Widget (https://vborg.vbsupport.ru/showthread.php?t=267024)

The Rocketeer 08-02-2011 11:16 AM

But Mooff, It is chmoded to 777, i even went in and set all the files and directorys(if any) inside that folder and made sure everything inside was also 777 and still didnt work :eek:

Mooff 08-02-2011 11:44 AM

I added 2 additional lines of debug in the code below.

But before you try them i have an idea.
Set: public_html/frontpage_nivo_slider/
To: frontpage_nivo_slider/



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 = 5;                               
           
//lengh in characters of the article descriptions
$description_length = 95;


//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 />';
}


 
   
$query = sprintf("
        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 = '%d') 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 > '%d' -34560000
        GROUP BY node.nodeid
        ORDER BY node.publishdate
        DESC LIMIT 20"
        ,$article_type,$time);
       
   
    $article_get = vB::$db->query_read($query);
    $database_articles = array();
   
    /* my version of sorting the articles via relevance - i'll keep it in case someone is interested*/
    while($article = vB::$db->fetch_array($article_get))
    {
        $article['value'] = ( 5 - ($time - $article['publishdate'] ) / 86400 ) * ( 5 - ($time - $article['publishdate'] ) / 86400 ) * ( 5 - ($time - $article['publishdate'] ) / 86400 ) + (10 * $article['replycount']);
        $database_articles[] = $article;       
    }
   
    foreach($database_articles as $c => $key)
    {
        $sort_value[] = $key['value'];
    }
   
    array_multisort($sort_value, SORT_DESC, $database_articles);   
   
    //
    $i = 0;
    $section_array = array();
    $featured_articles = array();
   
    foreach($database_articles AS $article)
    {
        $section_array[$article['parentnode']]++;

        $categories = explode(',' , $article['GROUP_CONCAT( category.category )']);
   
        if($show_articles_without_image == true OR $article['previewimage'])
        {
            if($section_array[$article['parentnode']] < 50 AND $i < $number_of_articles_shown)
            {
           
                //rebuild image to the height and width we want in the slider
                //called sprite since i got the code from our sprite addon :P
                $sprite = imagecreatetruecolor($maxwidth, $maxheight);
                if(is_resource($sprite) AND $article['previewimage'] )
                {                 
                    $imageinfo = getimagesize($article['previewimage']);
                    if(is_array($imageinfo))
                    { 
                        $image = null;
                        switch($imageinfo[2])
                        {
                            case IMAGETYPE_PNG:
                            $image = imagecreatefrompng($article['previewimage']);
                            break;
                            case IMAGETYPE_GIF:
                            $image = imagecreatefromgif($article['previewimage']);
                            break;
                            case IMAGETYPE_JPEG:
                            $image = imagecreatefromjpeg($article['previewimage']);
                            break;
                            default:
                            echo '<span style="color:red">Error occurred:</span> Unknown image format. ' . $article['previewimage']. '<br />';
                            break;                       
                        }
                       
                        if(!is_resource($image))
                        {
                            //resiziing did not work - we are using the fallback image.
                            $article['previewimage'] = $fallback_img;
                            echo '<span style="color:red">Error occurred:</span> imagecreation failed. ' . $article['previewimage']. '<br />';
                        }
                        else
                        {
                            $img_width = $imageinfo[0];
                            $img_height = $imageinfo[1];
                           
                            imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
                            imagedestroy($image);

                            $img_filepath = $slider_img_filepath . 'slide_' . $i . '.jpg';
                            $success = imagejpeg($sprite, DIR  . ($img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath);
                            imagedestroy($sprite);
                                                        if($success)
                                                        {
                                                                $article['previewimage'] = $img_filepath;
                                                        }
                                                        else
                                                        {
                                                                $img_filepath = DIR  . ($img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath;
                                                                echo '<span style="color:red">Error occurred:</span> imagejpeg failed. ' . $article['previewimage']. '<br />
                                                                directory: '. $img_filepath ;
                                                               
                                                                $article['previewimage'] = $fallback_img;
                                                        }
                        }
                       
                    }
                    else
                    {
                        //resiziing did not work - we are using the fallback image.
                        $article['previewimage'] = $fallback_img;
                        echo '<span style="color:red">Error occurred:</span> picture is not readable.' . $article['previewimage']. '<br /> ';
                    }                 
                }
                else
                {
                    //resiziing did not work - we are using the fallback image.
                    $article['previewimage'] = $fallback_img;
                    echo '<span style="color:red">Warning:</span> article has no previewimage or sprite is no ressource. ' . $article['previewimage']. '<br />';
                }
       

                /*remove everything from the previewtext - html and bb. I do not want bold or colored text there. Cut to a decent length.*/       
                $article['pagetext'] = strip_bbcode($article['pagetext'], true, true, false, true, false);

                $article['previewtext'] = strip_tags($article['pagetext'], '<a>');
                   
                $len = $description_length;
                if ( strlen($article['previewtext']) > $len )
                {                   
                    $article['previewtext'] = substr( $article['previewtext'] , 0 , strrpos( substr( $article['previewtext'], 0, $len), ' ' ));
                } 

                $i++;
                //Build Array
                $article_neu = array();
                $article_neu['description'] = '<h2 style="font-weight:bold; font-size: 14px">'. $article['title'].'</h2><span>'. $article['previewtext'] .'</span> <a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">read on</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $i ;
                $article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $i . '" /></a>';
               
                $featured_articles[] = $article_neu;
            }
        }
    }
   
    //Randomize Array
    //shuffle($featured_articles);
   
$output_bits = '
    <link rel="stylesheet" href="' .$slider_img_filepath. 'nivo-slider.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="' .$slider_img_filepath. 'nivo-slider_uf_theme.css" type="text/css" media="screen" />
    <div style="height:' . $maxheight . 'px;">
    <div id="wrapper">
        <div class="slider-wrapper theme-uf">
            <div class="ribbon"></div>
            <div id="slider" class="nivoSlider">';
           
                foreach($featured_articles AS $article)
                {
                    $output_bits .= $article['picture'];
                }
            $output_bits .= '
            </div>';
           
            foreach($featured_articles AS $article)
            {
                $output_bits .= '<div id="' . $article['htmlcaptionname'] . '" class="nivo-html-caption">' . $article['description'] .'</div>';
            }
           
            $output_bits .= '       
        </div>

    </div>
    <script type="text/javascript" src="clientscript/jquery/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="' .$slider_img_filepath. 'jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
        $("#slider").nivoSlider();
    });
    </script>
    </div>
    ';
        $output = $output_bits;
 
if($debug_modus === false)
{
        ob_end_clean();       
}


The Rocketeer 08-02-2011 11:52 AM

Quote:

Originally Posted by Mooff (Post 2228138)
I added 2 additional lines of debug in the code below.

But before you try them i have an idea.
Set: public_html/frontpage_nivo_slider/
To: frontpage_nivo_slider/



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 = 5;                               
           
//lengh in characters of the article descriptions
$description_length = 95;


//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 />';
}


 
   
$query = sprintf("
        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 = '%d') 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 > '%d' -34560000
        GROUP BY node.nodeid
        ORDER BY node.publishdate
        DESC LIMIT 20"
        ,$article_type,$time);
       
   
    $article_get = vB::$db->query_read($query);
    $database_articles = array();
   
    /* my version of sorting the articles via relevance - i'll keep it in case someone is interested*/
    while($article = vB::$db->fetch_array($article_get))
    {
        $article['value'] = ( 5 - ($time - $article['publishdate'] ) / 86400 ) * ( 5 - ($time - $article['publishdate'] ) / 86400 ) * ( 5 - ($time - $article['publishdate'] ) / 86400 ) + (10 * $article['replycount']);
        $database_articles[] = $article;       
    }
   
    foreach($database_articles as $c => $key)
    {
        $sort_value[] = $key['value'];
    }
   
    array_multisort($sort_value, SORT_DESC, $database_articles);   
   
    //
    $i = 0;
    $section_array = array();
    $featured_articles = array();
   
    foreach($database_articles AS $article)
    {
        $section_array[$article['parentnode']]++;

        $categories = explode(',' , $article['GROUP_CONCAT( category.category )']);
   
        if($show_articles_without_image == true OR $article['previewimage'])
        {
            if($section_array[$article['parentnode']] < 50 AND $i < $number_of_articles_shown)
            {
           
                //rebuild image to the height and width we want in the slider
                //called sprite since i got the code from our sprite addon :P
                $sprite = imagecreatetruecolor($maxwidth, $maxheight);
                if(is_resource($sprite) AND $article['previewimage'] )
                {                 
                    $imageinfo = getimagesize($article['previewimage']);
                    if(is_array($imageinfo))
                    { 
                        $image = null;
                        switch($imageinfo[2])
                        {
                            case IMAGETYPE_PNG:
                            $image = imagecreatefrompng($article['previewimage']);
                            break;
                            case IMAGETYPE_GIF:
                            $image = imagecreatefromgif($article['previewimage']);
                            break;
                            case IMAGETYPE_JPEG:
                            $image = imagecreatefromjpeg($article['previewimage']);
                            break;
                            default:
                            echo '<span style="color:red">Error occurred:</span> Unknown image format. ' . $article['previewimage']. '<br />';
                            break;                       
                        }
                       
                        if(!is_resource($image))
                        {
                            //resiziing did not work - we are using the fallback image.
                            $article['previewimage'] = $fallback_img;
                            echo '<span style="color:red">Error occurred:</span> imagecreation failed. ' . $article['previewimage']. '<br />';
                        }
                        else
                        {
                            $img_width = $imageinfo[0];
                            $img_height = $imageinfo[1];
                           
                            imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
                            imagedestroy($image);

                            $img_filepath = $slider_img_filepath . 'slide_' . $i . '.jpg';
                            $success = imagejpeg($sprite, DIR  . ($img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath);
                            imagedestroy($sprite);
                                                        if($success)
                                                        {
                                                                $article['previewimage'] = $img_filepath;
                                                        }
                                                        else
                                                        {
                                                                $img_filepath = DIR  . ($img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath;
                                                                echo '<span style="color:red">Error occurred:</span> imagejpeg failed. ' . $article['previewimage']. '<br />
                                                                directory: '. $img_filepath ;
                                                               
                                                                $article['previewimage'] = $fallback_img;
                                                        }
                        }
                       
                    }
                    else
                    {
                        //resiziing did not work - we are using the fallback image.
                        $article['previewimage'] = $fallback_img;
                        echo '<span style="color:red">Error occurred:</span> picture is not readable.' . $article['previewimage']. '<br /> ';
                    }                 
                }
                else
                {
                    //resiziing did not work - we are using the fallback image.
                    $article['previewimage'] = $fallback_img;
                    echo '<span style="color:red">Warning:</span> article has no previewimage or sprite is no ressource. ' . $article['previewimage']. '<br />';
                }
       

                /*remove everything from the previewtext - html and bb. I do not want bold or colored text there. Cut to a decent length.*/       
                $article['pagetext'] = strip_bbcode($article['pagetext'], true, true, false, true, false);

                $article['previewtext'] = strip_tags($article['pagetext'], '<a>');
                   
                $len = $description_length;
                if ( strlen($article['previewtext']) > $len )
                {                   
                    $article['previewtext'] = substr( $article['previewtext'] , 0 , strrpos( substr( $article['previewtext'], 0, $len), ' ' ));
                } 

                $i++;
                //Build Array
                $article_neu = array();
                $article_neu['description'] = '<h2 style="font-weight:bold; font-size: 14px">'. $article['title'].'</h2><span>'. $article['previewtext'] .'</span> <a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">read on</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $i ;
                $article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $i . '" /></a>';
               
                $featured_articles[] = $article_neu;
            }
        }
    }
   
    //Randomize Array
    //shuffle($featured_articles);
   
$output_bits = '
    <link rel="stylesheet" href="' .$slider_img_filepath. 'nivo-slider.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="' .$slider_img_filepath. 'nivo-slider_uf_theme.css" type="text/css" media="screen" />
    <div style="height:' . $maxheight . 'px;">
    <div id="wrapper">
        <div class="slider-wrapper theme-uf">
            <div class="ribbon"></div>
            <div id="slider" class="nivoSlider">';
           
                foreach($featured_articles AS $article)
                {
                    $output_bits .= $article['picture'];
                }
            $output_bits .= '
            </div>';
           
            foreach($featured_articles AS $article)
            {
                $output_bits .= '<div id="' . $article['htmlcaptionname'] . '" class="nivo-html-caption">' . $article['description'] .'</div>';
            }
           
            $output_bits .= '       
        </div>

    </div>
    <script type="text/javascript" src="clientscript/jquery/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="' .$slider_img_filepath. 'jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
        $("#slider").nivoSlider();
    });
    </script>
    </div>
    ';
        $output = $output_bits;
 
if($debug_modus === false)
{
        ob_end_clean();       
}


ah magnifico! I just changed it to frontpage_nivo_slider/ and the images are appearing perfectly! a bit choppy but perfect! Thank you mooff. I will come back tomorrow and give you even more ideas to improve this mod! :o

Reycer 08-03-2011 12:29 AM

It brought IE9 to a complete stop and it froze. Can someone else take a look using IE and see if it loads slow for them? The transitions don't seem to work as well either in IE. Here's a link to my forum.

Mooff 08-03-2011 10:33 PM

Just checked on our 4.1.5 testboard.
Slider is running fine. The CMS changes do not affect it at all. I'll update the code tomorrow (to account for the different 4.1.5 jquery file) and probably also take a shot at the article id query.

Sidenote: Sorry to all guys who tried out the livedemo link the last few days. We changed our cms rewrite rule from /content/ to /news/ and i forgot about the link in here, which unfortunally redirected you to our forum instead our cms page. Therefore not showing you the slider livedemo. It's fixed now, so if you want to take a look, feel free to do so. =)

Sm1th146 08-03-2011 11:54 PM

I'm sorry but I have to ask. I installed the widget and love the mod but I am struggling to get it to work properly. I turned the debug mode so it's on but yet still can't find the problem. This is the error message I'm getting with the debug mode on.

Code:

DEBUG MODE is ON!
slider_img_filepath: http://tokengaming.com/forums/uf_nivo_slider/
width: 650 height: 250
show_articles_without_image:
fallback_img: http://tokengaming.com/forums/uf_nivo_slider/old-tunnel.jpg
#img: 5
description_length: 95
directory /home/tokeng5/public_html/forums

Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://tokengaming.com/forums/uf_nivo_slider/slide_0.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 166
Error occurred: imagejpeg failed. http://www.tokengaming.com/forums/attachment.php?attachmentid=36&cid=24
directory: /home/tokeng5/public_html/forums/http://tokengaming.com/forums/uf_nivo_slider/slide_0.jpg


Mooff 08-04-2011 08:02 AM

Hi, the addon can't write files via a http connection, so slider_img_filepath has to be local.

In your case uf_nivo_slider/ seems to be the right path for $slider_img_filepath instead of [url ]http://tokengaming.com/forums/uf_nivo_slider/[/url]

MikalMirkas 08-04-2011 08:26 AM

Hello, I'm having an issue. It isn't pulling images from any articles... (even though there aren't any, still doesn't scroll through the articles)
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 = '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 = 5;                               
           
//lengh in characters of the article descriptions
$description_length = 95;


//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 />';
}


 
   
$query = sprintf("
        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 = '%d') 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 > '%d' -34560000
        GROUP BY node.nodeid
        ORDER BY node.publishdate
        DESC LIMIT 20"
        ,$article_type,$time);
       
   
    $article_get = vB::$db->query_read($query);
    $database_articles = array();
   
    /* my version of sorting the articles via relevance - i'll keep it in case someone is interested*/
    while($article = vB::$db->fetch_array($article_get))
    {
        $article['value'] = ( 5 - ($time - $article['publishdate'] ) / 86400 ) * ( 5 - ($time - $article['publishdate'] ) / 86400 ) * ( 5 - ($time - $article['publishdate'] ) / 86400 ) + (10 * $article['replycount']);
        $database_articles[] = $article;       
    }
   
    foreach($database_articles as $c => $key)
    {
        $sort_value[] = $key['value'];
    }
   
    array_multisort($sort_value, SORT_DESC, $database_articles);   
   
    //
    $i = 0;
    $section_array = array();
    $featured_articles = array();
   
    foreach($database_articles AS $article)
    {
        $section_array[$article['parentnode']]++;

        $categories = explode(',' , $article['GROUP_CONCAT( category.category )']);
   
        if($show_articles_without_image == true OR $article['previewimage'])
        {
            if($section_array[$article['parentnode']] < 50 AND $i < $number_of_articles_shown)
            {
           
                //rebuild image to the height and width we want in the slider
                //called sprite since i got the code from our sprite addon :P
                $sprite = imagecreatetruecolor($maxwidth, $maxheight);
                if(is_resource($sprite) AND $article['previewimage'] )
                {                 
                    $imageinfo = getimagesize($article['previewimage']);
                    if(is_array($imageinfo))
                    { 
                        $image = null;
                        switch($imageinfo[2])
                        {
                            case IMAGETYPE_PNG:
                            $image = imagecreatefrompng($article['previewimage']);
                            break;
                            case IMAGETYPE_GIF:
                            $image = imagecreatefromgif($article['previewimage']);
                            break;
                            case IMAGETYPE_JPEG:
                            $image = imagecreatefromjpeg($article['previewimage']);
                            break;
                            default:
                            echo '<span style="color:red">Error occurred:</span> Unknown image format. ' . $article['previewimage']. '<br />';
                            break;                       
                        }
                       
                        if(!is_resource($image))
                        {
                            //resiziing did not work - we are using the fallback image.
                            $article['previewimage'] = $fallback_img;
                            echo '<span style="color:red">Error occurred:</span> imagecreation failed. ' . $article['previewimage']. '<br />';
                        }
                        else
                        {
                            $img_width = $imageinfo[0];
                            $img_height = $imageinfo[1];
                           
                            imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
                            imagedestroy($image);

                            $img_filepath = $slider_img_filepath . 'slide_' . $i . '.jpg';
                            $success = imagejpeg($sprite, DIR  . ($img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath);
                            imagedestroy($sprite);
                                                        if($success)
                                                        {
                                                                $article['previewimage'] = $img_filepath;
                                                        }
                                                        else
                                                        {
                                                                $img_filepath = DIR  . ($img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath;
                                                                echo '<span style="color:red">Error occurred:</span> imagejpeg failed. ' . $article['previewimage']. '<br />
                                                                directory: '. $img_filepath ;
                                                               
                                                                $article['previewimage'] = $fallback_img;
                                                        }
                        }
                       
                    }
                    else
                    {
                        //resiziing did not work - we are using the fallback image.
                        $article['previewimage'] = $fallback_img;
                        echo '<span style="color:red">Error occurred:</span> picture is not readable.' . $article['previewimage']. '<br /> ';
                    }                 
                }
                else
                {
                    //resiziing did not work - we are using the fallback image.
                    $article['previewimage'] = $fallback_img;
                    echo '<span style="color:red">Warning:</span> article has no previewimage or sprite is no ressource. ' . $article['previewimage']. '<br />';
                }
       

                /*remove everything from the previewtext - html and bb. I do not want bold or colored text there. Cut to a decent length.*/       
                $article['pagetext'] = strip_bbcode($article['pagetext'], true, true, false, true, false);

                $article['previewtext'] = strip_tags($article['pagetext'], '<a>');
                   
                $len = $description_length;
                if ( strlen($article['previewtext']) > $len )
                {                   
                    $article['previewtext'] = substr( $article['previewtext'] , 0 , strrpos( substr( $article['previewtext'], 0, $len), ' ' ));
                } 

                $i++;
                //Build Array
                $article_neu = array();
                $article_neu['description'] = '<h2 style="font-weight:bold; font-size: 14px">'. $article['title'].'</h2><span>'. $article['previewtext'] .'</span> <a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">read on</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $i ;
                $article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $i . '" /></a>';
               
                $featured_articles[] = $article_neu;
            }
        }
    }
   
    //Randomize Array
    //shuffle($featured_articles);
   
$output_bits = '
    <link rel="stylesheet" href="' .$slider_img_filepath. 'nivo-slider.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="' .$slider_img_filepath. 'nivo-slider_uf_theme.css" type="text/css" media="screen" />
    <div style="height:' . $maxheight . 'px;">
    <div id="wrapper">
        <div class="slider-wrapper theme-uf">
            <div class="ribbon"></div>
            <div id="slider" class="nivoSlider">';
           
                foreach($featured_articles AS $article)
                {
                    $output_bits .= $article['picture'];
                }
            $output_bits .= '
            </div>';
           
            foreach($featured_articles AS $article)
            {
                $output_bits .= '<div id="' . $article['htmlcaptionname'] . '" class="nivo-html-caption">' . $article['description'] .'</div>';
            }
           
            $output_bits .= '       
        </div>

    </div>
    <script type="text/javascript" src="clientscript/jquery/jquery-1.6.1.min.js"></script>
    <script type="text/javascript" src="' .$slider_img_filepath. 'jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
        $("#slider").nivoSlider();
    });
    </script>
    </div>
    ';
        $output = $output_bits;
 
if($debug_modus === false)
{
        ob_end_clean();       
}

is my "PHP Direct Execution" Widget. Halp?
Running on 4.1.5.

Edit:
Here's my Debug Code:
Code:

DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
show_articles_without_image:
fallback_img: slider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /home/prknigh1/public_html/forum

Double Edit: Since you own UF, how do you get your widgets without a border and title? Thanks.

Mooff 08-04-2011 09:28 AM

Titles were removed via template edits. Find the template for the php execution widget (name starts with vbcms_widget_ ) you will find the right one then.

search and delete
Code:

                <div class="cms_widget_header">
                <h3><img src="{vb:stylevar imgdir_misc}/php.png" alt="" /> {vb:raw widget_title}</h3>
                </div>

Warning! This does delete the title on all your php widgets. Not just the slider.
You then have to rewrite your other widget to account for that and include the title there.
(of course you also could create a new template for the slider, modify that to your needs and tell the slider executing php widget via the vbcms configuration in the acp to use the other template)

As for borders and optical appearance of our cms. I think most of it can be done via stylevars. I'm not sure anymore since in some places i had to brutally take stabs at the vbcms.css file or include some custom css classes into the additional.css


As for your problem, not sure. Everything looks fine, no debug errors given. I need additional debug and a link to a testsite would be great.

search
Code:

    //Randomize Array
    //shuffle($featured_articles);

replace
Code:

    //Randomize Array
    //shuffle($featured_articles);
  echo '<pre>';
  var_dump($featured_articles);
  echo '</pre>';

Run that in debug mode and it is going to give you a huge load of text on top of your page. Send me that text.

Mooff 08-04-2011 10:32 AM

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).

MikalMirkas 08-05-2011 03:01 AM

Test Site: www.teabagtheenemy.com/forum/content.php
Debug Mode Text:
Code:

DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
show_articles_without_image:
fallback_img: slider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /home/prknigh1/public_html/forum

array(0) {
}


Mooff 08-05-2011 08:09 AM

I see, thanks for the link. :)

First, the switch "show_articles_without_image is set to false" and you do not have articles with images (as far as i can see as a guest) so the slider does show nothing.
Another problem might be the default date range i included, this is set to 40 days. Any article older than that isn't shown. Can be changed easily though.

Secondly, you have 3 jquery files included in the source code of your page. jquery-1.6.1 / jquery.js and jquery-1.3.2min. That does cause problems and you do not need all 3. Reduce this to one (but be sure to use a version above 1.4)

Ramsesx 08-05-2011 08:21 PM

Great stuff Mooff, thanks for it, do you have a hint how I can get the slider aligned left?
See here. Thanks.

Mooff 08-05-2011 08:37 PM

search for this code in the nivo-slider_uf_theme.css file
Code:

.theme-uf #slider {
    height: 290px;
    margin: 0 auto;
    width: 470px;
}

replace with
Code:

.theme-uf #slider {
    height: 290px;
    width: 470px;
}


Ramsesx 08-05-2011 08:43 PM

That's it. Thanks for your outstanding support. :up:

MikalMirkas 08-06-2011 05:08 AM

Quote:

Originally Posted by Mooff (Post 2229579)
I see, thanks for the link. :)

First, the switch "show_articles_without_image is set to false" and you do not have articles with images (as far as i can see as a guest) so the slider does show nothing.
Another problem might be the default date range i included, this is set to 40 days. Any article older than that isn't shown. Can be changed easily though.

Secondly, you have 3 jquery files included in the source code of your page. jquery-1.6.1 / jquery.js and jquery-1.3.2min. That does cause problems and you do not need all 3. Reduce this to one (but be sure to use a version above 1.4)

So what size do I want the images to be?
Also, I ran a template search and couldn't find it.

Mooff 08-06-2011 08:34 AM

The slider does not care what size your images are.
Your articles either need to have a preview image - or you have to set "show_articles_without_image" to true in the options, then it will show a default image you can specify for articles without image.

What image size do you want the slider to use? That's a question only you can answer.

Template search? You mean for the other jquery files? You can see what they are called if you check the page via source code (in firefox ctrl+u).
You have this one:
<script type="text/javascript" src="/forum/arrowchat/includes/js/jquery.js"></script>
and that one:
<script type="text/javascript" src="steamprofile/jquery-1.3.2.min.js"></script>
and of course the slider one:
<script type="text/javascript" src="clientscript/jquery/jquery-1.6.1.min.js"></script>

As for guessing, the other ones come from a chat addon and a steam addon.

MikalMirkas 08-06-2011 08:37 AM

Quote:

Originally Posted by Mooff (Post 2230006)
The slider does not care what size your images are.
Your articles either need to have a preview image - or you have to set "show_articles_without_image" to true in the options, then it will show a default image you can specify for articles without image.

What image size do you want the slider to use? That's a question only you can answer.


Template search? You mean for the other jquery files? You can see what they are called if you check the page via source code (in firefox ctrl+u).
You have this one:
<script type="text/javascript" src="/forum/arrowchat/includes/js/jquery.js"></script>
and that one:
<script type="text/javascript" src="steamprofile/jquery-1.3.2.min.js"></script>
and of course the slider one:
<script type="text/javascript" src="clientscript/jquery/jquery-1.6.1.min.js"></script>

As for guessing, the other ones come from a chat addon and a steam addon.

So, is it a giant ordeal if I have all those jqueries there, or can I just use a higher jquery and remove all the other ones?

Mooff 08-06-2011 08:44 AM

Use a higher jquery and remove the other ones. Jquery is known to have conflicts if more than one file is included.

But, you need to load your jquery file above all your addons which need the jquery code.

MikalMirkas 08-06-2011 08:47 AM

Quote:

Originally Posted by Mooff (Post 2230010)
Use a higher jquery and remove the other ones. Jquery is known to have conflicts if more than one file is included.

But, you need to load your jquery file above all your addons which need the jquery code.

I got the Slider to work. Just need to make it resize with the box. If you resize the page, it'll clip into the red box...
hm.
derp.

starman? 08-06-2011 09:32 AM

Hey Mooff,

This is driving me crazy man. I've done just about everything I can think of and everything suggested here to get this working but after running in debug I get this;

DEBUG MODE is ON!
slider_img_filepath: /nivoslider/
width: 480 height: 320
show_articles_without_image: bool(true)
fallback_img: /nivoslider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /home2/hzscenec/public_html
Error occurred: picture is not readable./nivoslider/uf_fallback_slider.png
Error occurred: picture is not readable./nivoslider/uf_fallback_slider.png
Error occurred: picture is not readable./nivoslider/uf_fallback_slider.png
#articles - featured and databasepull int(4) int(4)

Clearly this has to do with the images not being readable, but how do I change it so that they are? Any ideas man?

Cheers

starman? 08-06-2011 09:47 AM

Finally worked it out. Yeahhhhhhhhhhhhhh! CMS Permissions need to be changed to make the content downloadable to the public. Please add this info to your instructions. Thanks for a great product. Cheers.

Mooff 08-06-2011 09:59 AM

@MikalMirkas
The Nivo Slider doesn't support resizing on the fly.
You can change the width and height or the slider in general though and add a minimum width to your slider php widget.

@starman
Great to hear. :)
The information is allready in the faq ((cms)attachments need to be readable for guests). I changed the first post and included a link to the faq based on your feedback though.

starman? 08-06-2011 10:06 AM

Must have missed that one. Thanks again.

MikalMirkas 08-06-2011 10:07 AM

Quote:

Originally Posted by Mooff (Post 2230028)
@MikalMirkas
The Nivo Slider doesn't support resizing on the fly.
You can change the width and height or the slider in general though and add a minimum width to your slider php widget.

@starman
Great to hear. :)
The information is allready in the faq ((cms)attachments need to be readable for guests). I changed the first post and included a link to the faq based on your feedback though.

O.o
Then how come UF's resizes on the fly? D:

starman? 08-06-2011 10:14 AM

Just spotted an anomaly. After about 5 mins the text disappears leaving just a black bar. My cache is set to 120 mins for this widget. Any idea why?

Mooff 08-06-2011 10:16 AM

We don't? Our slider is fixed to width 650px height 250px and our cms width is fixed to 1000px.

@starman
Sorry, no idea. That is a question for the nivo slider developers: http://nivo.dev7studios.com/

starman? 08-06-2011 10:21 AM

Okay no worries man. I guess it's not a problem as you wouldn't watch it for more than a minute anyway I guess.

Mooff 08-06-2011 10:23 AM

I won't show up every time though. I had the slider once running > 20minutes in another browser i forgot to close - and the caption did not disappear.
But yes, you are right. Probably can be considored a minor bug.

djilou 08-06-2011 01:53 PM

Hi,

Thanks for this awesome mod, I have 2 questions :

1- I want to dispaly the Slider only on the home page, not when I browse articles, like here : http://www.united-forum.de/news/

How to do this?

2- I use vbseo on my website, I want urls to be like this : http://www.united-forum.de/news/comm...rs-cc-229.html

instead of
http://www.united-forum.de/content.p...rs-cc-229.html

Mooff 08-06-2011 02:46 PM

1- depends. Works via different layouts on different sections.
two options
a) you do not show articles on your homepage, only widgets. Then adding a subsection which shows the slider and telling vb in the acp to show that subsection instead of the main section will be enough.
b) you do show articles on your homepage, then create a hidding second section below your newssection with a different layout without slider. Move all categories* and articles to that second section. Set the homepage to 'show all articles from subsections.

2- activate cms rewrite in the vbseo command panel. There look for extended options (or similar, haven't checked how it is called exactly) and follow the instructions for custom rewrites.

*be careful here, moving categories via the acp is the buggiest piece of *** i have ever experienced in the vb_acp. If you can, i would strongly advise you to do it manually in the database. And backup your database before that!

MikalMirkas 08-07-2011 03:58 AM

Quote:

Originally Posted by Mooff (Post 2230034)
We don't? Our slider is fixed to width 650px height 250px and our cms width is fixed to 1000px.

@starman
Sorry, no idea. That is a question for the nivo slider developers: http://nivo.dev7studios.com/

How does one manage to do this? I've tried it before but screwed up my CMS.
doc_width?
Edit: k set doc_width to 1000 but now it's aligned to the left side of the page.

Mooff 08-07-2011 11:43 AM

set doc_margin to 'auto' as said in the doc_margin stylevar description.

nader 08-08-2011 03:27 AM

Beautiful work; I was waiting for long time unfortunately It is very slow!

Aramist 08-10-2011 09:41 AM

Hi mooff !

I need your help.

In your script, when someone reply an article, the slide goes to the front of the slider cycle.

In my board I don't wanna show again older slides.

How can I change this ?

Ty in advance

Aramist 08-10-2011 09:45 AM

hmmm nvm....

I've removed
Code:

+ (10 * $article['replycount'])
and now it does not count replies to make a slide appear...

It's how I need now...ty anyway. :D

Loversama 08-10-2011 01:16 PM

Can you make this work with: Article Forums v4.x?
https://vborg.vbsupport.ru/showthread.php?t=237116

I don't use VB CMS and already use this slider (but I use it manually) for it to work with Article Forums would be amazing and would solve all my problems!


Thanks :D

Wordplay 08-10-2011 08:44 PM

is it possible to have this work with forumposts rather than articles and have this load selected images to each slide?

that would make this so amazing. for my site i had to change the size to 830x320 for it to show up decently, i can't get it to load the article images right now, but even if i could most are 240x240 and wouldn't look right in 830x320.

Mooff 08-10-2011 09:11 PM

@Aramist

If you do not want the value sorting function you can remove the whole sorting part and therefore gain a bit in performance (not that much, but well a bunch of calculations are unnecessary then).
(untested!)

search for:
Code:

    /* my version of sorting the articles via relevance - i'll keep it in case someone is interested*/
    while($article = vB::$db->fetch_array($article_get))
    {
        $article['value'] = ( 5 - ($time - $article['publishdate'] ) / 86400 ) * ( 5 - ($time - $article['publishdate'] ) / 86400 ) * ( 5 - ($time - $article['publishdate'] ) / 86400 ) + (10 * $article['replycount']);
        $database_articles[] = $article;       
    }
   
    foreach($database_articles as $c => $key)
    {
        $sort_value[] = $key['value'];
    }
   
    array_multisort($sort_value, SORT_DESC, $database_articles);   
   
    //
    $i = 0;
    $section_array = array();
    $featured_articles = array();
       
    foreach($database_articles AS $article)
    {

replace with
Code:

    $i = 0;
    $section_array = array();
    $featured_articles = array();
       
    while($article = vB::$db->fetch_array($article_get))
    {


@ Loversama
I do not know what that mod does in terms of database changes and i do not have it installed and i cannot install it on our board, nor can i install it in our testboard (there we have 3 different unreleased projects right now which i can't risk to compromise).

@ Wordplay
Working with forumposts would need a database query rewrite.
That beeing said. What can be done is showing title and description of threads and then using images based on the forum they are in. What can't be done is searching through the pagetext to find an image suited for the slider.
(Well it can, but i can't debug that and it does need a lot of thinking and work. Work which will have no use on our board. Sorry.)
As for article images not beeing suited for the slider. We do face the same problem on our board. Therefore we are using a highly customized version which does account for our needs. Like using section and category based images as fallbacks and resizeing images only for images which are at least 400px wide and have a width/height ratio between 2.5 and 2.8.
Options i can not set as default for everyone. But as said in the first post, if one does need something fancy i might be able to help with some custom code for your board. No promises though. And i need to know exactly what one does want. Exactly. Like explaining it to your grandma exactly ;)

Wordplay 08-10-2011 09:45 PM

well this is the best slide i've ever seen:
http://www.bet.com/shows.html


i would like to impliment that into my site. is there really no way to make it just pick the first image attached to a thread?

if there is no way to make it collect information from a specific forumthread, and that slide with thumbnails would work on articles, i'll just change my forum setup around to use articles rather than forumposts to post news.

does the slider randomly pick an image from an article or does it pick out the first attachment in an article?

right now i can't get it to display any images from the articles. it just shows my default fall back image on every news article.


All times are GMT. The time now is 08:56 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04355 seconds
  • Memory Usage 2,108KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (16)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete