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)

Mooff 11-14-2011 01:21 AM

We are using php 5.3.8 (that's the latest stable release).

Your link doesn't help btw. I'm not using include() anywhere in the code. And i can't rewrite it so that it looks for the files in a local path, cause well, not all of them are stored locally. Preview pictures can be anything from attachement, to local image, to external image.

There *might* be a way getting around allowing url_open, which would be cURL, but finding out how cURL works involves a lot of time. And i'm not even sure it does work and i can't test it since we won't disable the allow_url_open setting on our box anyway.

mmoore5553 11-14-2011 08:07 PM

I do not know why but no picture is showing up but just the default no picture. Is this pulling inline images or attachements ? I am confused on what it trying to pull or at this point not pull. I have checked the faq and still lost.

jo8jo 11-15-2011 08:13 AM

Hi, the slider widget works fine for me :up: Great work ;)

One more problem i cannot solve:
I'm using this mod: VBCMS Threads promoted to articles link to forum thread no more article pages to link by clicking "Read more" to the original forum thread - not to the article!

The code in "vbcms_content_article_preview" changes to this:

Code:

<vb:if condition="$preview_chopped">
<span class="cms_article_readmore"><a href="{vb:raw vboptions.bburl}/showpost.php?{vb:raw session.sessionurl}p={vb:raw postid}">{vb:rawphrase read_more_phrase} <img src="{vb:stylevar imgdir_cms}/read_more-{vb:stylevar right}.png" alt="{vb:rawphrase read_more_phrase}" /></a>
</span>
</vb:if>

Original code:

Code:

<vb:if condition="$preview_chopped">
<span class="cms_article_readmore"><a href="{vb:raw page_url}">{vb:rawphrase read_more_phrase} <img src="{vb:stylevar imgdir_cms}/read_more-{vb:stylevar right}.png" alt="{vb:rawphrase read_more_phrase}" /></a>
</span>
</vb:if>

I want to click on the slider image or preview text and get forwarded to the forum thread - not to the article. I think i need to change the following php codeof the slider widget code to get the effect from above: :confused:

Code:

<span>'. $article['previewtext'] .'</span> <a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">More</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
                $article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">


I would be thankful for your suggestions :)

blackracoon 11-15-2011 02:42 PM

Hi Moof,

I have checked through, an image is being generated in the folder /slider if I put an attachment in the article, I'm using the jquery by vbulletin in the clientscripts folder so that there was definately no double ups (it's the correct directory I checked the source and it links correctly). But something just isn't working correctly.. seems like a formatting issue, but we cannot see any of the images or functionality buttons.

The directory is 777, I can see the .css file as per your test in the FAQ's to ensure the directory setting is correct. (img path).

The directory is slider/

I have enabled debugging on the site for viewing to see if anyone else has a clue of what may be going on..

http://www.etozclan.com/vbulletin

I've seen it in action on a few other peoples site it looks very nice, hoping we can get it succesfully configured and running.

- I have also enabled show article with no image so the default image shows, but that also does not work, even though the directory is 777 the directory is accessible and jquery is linked.. it seems.. :(

Regards

Mooff 11-15-2011 03:21 PM

@jo8jo
this should work (untested code)

search
Code:

        $article_get = vB::$db->query_read('
        SELECT
            article.pagetext,
            article.previewimage,
            node.url,
            node.publishdate,
            node.parentnode,

replace with
Code:

        $article_get = vB::$db->query_read('
        SELECT
            article.pagetext,
            article.previewimage,
            article.threadid,
            node.url,
            node.publishdate,
            node.parentnode,

search
Code:

<span>'. $article['previewtext'] .'</span> <a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">More</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
                $article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">

replace with
Code:

<span>'. $article['previewtext'] .'</span> <a href="/showthread.php?t=' . $article['threadid'] . '-' . article['url'] . '">More</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
                $article_neu['picture'] = '<a href="/showthread.php?t=' . $article['threadid'] . '-' . $article['url'] . '">

@mmoore5553
It's pulling whatever is stored by vbulletin as article preview picture. Please check the last FAQ question.

@blackracoon
everything looks fine coding wise, but firebug tells me that there is a jquery error when i open your site
Code:

$("#slider") is null
Line 355

I do not know where that is comeing from. Can you try to include a different jquery file (not the vbulletin version) and see if that does fix it?

blackracoon 11-15-2011 03:59 PM

Hi Moof,

It seems to still be bugged. I have included jquery in the slider widget now but I believe the exact same thing is happening. :(

Any other clues?

Regards

mmoore5553 11-16-2011 06:05 AM

Okay here is what my debug says
Also the no image pulls up fine.
Code:

slider_img_filepath: http://www.wpcreations.net/vbbarefoot/slider/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: http://www.wpcreations.net/vbbarefoot/slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/mmoore/public_html/vbbarefoot

Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_434.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/wildlifejohn1a.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_434.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_432.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/hennaback1.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_432.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_427.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/moreoddlooksartwork_sm.png
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_427.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_426.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/dirt50m1.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_426.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_424.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/stop-stretching.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_424.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_423.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/germany_dresden1.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_423.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_422.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/zen_circle.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_422.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_421.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/oxygenconsumption2.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_421.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_420.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/indianrunners_0.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_420.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_411.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/d_2b.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_411.jpg#articles - featured and databasepull int(10) int(20)


blackracoon 11-16-2011 06:19 AM

@Nmoore to resolve your issue please change in your php widget for your slider to $slider_img_filepath = 'slider/';

That should resolve your issue.

Regards, Racoon.

mmoore5553 11-16-2011 06:37 AM

wow amazing i did not even think of that. It is working great now. Thank you so much.

blackracoon 11-16-2011 01:31 PM

Hi,

So after hours of scanning through I worked out the issue to having a white screen, all your directories are corrrect and you retrieve this error only in firebug -

$("#slider").nivoSlider not found.

FIX:

Go to your widget you made, scroll to very end almost and edit this line:

$("#slider").nivoSlider

to

JQuery("#slider").nivoSlider

This is actually the correct way it should be called. a $ is the common way, it may not pick up the last imported library is JQuery especially if it isn't.

Regards, and Good luck!

DoDe 11-16-2011 02:13 PM

In opera after installing this add-on my background of the entire website is white even if in doc_background is black.
In explorer, chrome and firefox is ok.
What could be the cause?

mmoore5553 11-17-2011 11:00 PM

I found a weird issue. Everything is working fine but after some time the captions do not show up. There is no text. Anyone else run into this at all ?

DoDe 11-19-2011 09:46 AM

Any chance to get some solution for my problem with the white background of the entire web page on opera browser?

mmoore5553 11-20-2011 01:36 AM

I love this mod but found one error. If you let it just run for awhile it will crash. The text goes away. I think this is an issue with javascript. Is there a way to use built in vb javascript or workaround ?

Also is there a way to just have it on cms homepage ?

ablaye 11-21-2011 02:14 AM

Why does it so long to load the first image??
If you go to my site at http://www.ndakaru.com/ , you can see when you load the page that the box when the slideshow is displayed stays white for a while (a few seconds) before the display starts.
Is there any way to speed this up?

Thanks

Mooff 11-21-2011 02:40 AM

@DoDe
Doesn't happen on our page with opera so without a link to your page it's though to guess what might be happening.

@mmoore5553
that text disapearing bug is a nivo slider bug, not a bug comeing from my vbulletin bridge to the slider.
The FAQ should provide enough hints to switch out the jquery file.
Having widgets just showing up on the homepage and not above articles is independent of the slider. But was already answered somewhere in this thread and multiple times on vb.org. Please do a quick search.

@ablaye
I do not experience this behaviour while loading your site.

jack-d 11-21-2011 04:03 AM

I set this up as is and it worked fine, vB 4.1.8 but I chose to pull from a specific section modifying the code as in this post,

HTML Code:

https://vborg.vbsupport.ru/showpost.php?p=2233429&postcount=144
After that change I only get the fallback image now. The path is correct and the section ID is correct because it is pulling the title and text of the article but only the fallback picture.

Been reading through this for hours and can't find a solution.

Anyone have any ideas.


EDIT: Fixed, problem with png files I have found out. No transparent bg images because of the effects.

SRSC 11-21-2011 01:49 PM

Quote:

Originally Posted by jo8jo (Post 2268115)
Hi, the slider widget works fine for me :up: Great work ;)

One more problem i cannot solve:
I'm using this mod: VBCMS Threads promoted to articles link to forum thread no more article pages to link by clicking "Read more" to the original forum thread - not to the article!

The code in "vbcms_content_article_preview" changes to this:

Code:

<vb:if condition="$preview_chopped">
<span class="cms_article_readmore"><a href="{vb:raw vboptions.bburl}/showpost.php?{vb:raw session.sessionurl}p={vb:raw postid}">{vb:rawphrase read_more_phrase} <img src="{vb:stylevar imgdir_cms}/read_more-{vb:stylevar right}.png" alt="{vb:rawphrase read_more_phrase}" /></a>
</span>
</vb:if>

Original code:

Code:

<vb:if condition="$preview_chopped">
<span class="cms_article_readmore"><a href="{vb:raw page_url}">{vb:rawphrase read_more_phrase} <img src="{vb:stylevar imgdir_cms}/read_more-{vb:stylevar right}.png" alt="{vb:rawphrase read_more_phrase}" /></a>
</span>
</vb:if>

I want to click on the slider image or preview text and get forwarded to the forum thread - not to the article. I think i need to change the following php codeof the slider widget code to get the effect from above: :confused:

Code:

<span>'. $article['previewtext'] .'</span> <a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">More</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
                $article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">


I would be thankful for your suggestions :)

you can use my modified code:

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 = 600;                                 
$maxheight = 300;   

//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 = 200;

//stretch picture or crop them? false = strechting (default) true = cropping (beta)
$crop = false;


//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 "Strech or Crop? $crop <br />";
        echo "show_articles_without_image: ";
        var_dump($show_articles_without_image);
        echo " <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,
            article.postid,
            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) .' -34560000 AND
                        node.publishdate < '. vb::$db->sql_prepare($time) .'
        GROUP BY node.nodeid
        ORDER BY node.publishdate
        DESC LIMIT 20');

    $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)
            {
                                if($debug_modus == true OR !file_exists($slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg'))
                                {
                                        //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.
                                                                echo '<span style="color:red">Error occurred:</span> imagecreation failed. ' . $article['previewimage']. '<br />';
                                                                $article['previewimage'] = $fallback_img;
                                                        }
                                                        else
                                                        {
                                                                $img_width = $imageinfo[0];
                                                                $img_height = $imageinfo[1];                                                       
                                                               
                                                                if($crop == false)
                                                                {                                                                       
                                                                        imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
                                                                        imagedestroy($image);
                                                                }
                                                                else
                                                                {
                                                                        //cropping
                                                                        $ratiox = $maxheight / $img_height ;
                                                                        $ratioy = $maxwidth / $img_width ;
                                                                        $new_height = $img_height;
                                                                        $new_width = $img_width;
                                                                       
                                                                        if ($maxheight > $img_height OR $maxwidth > $img_width)
                                                                        {
                                                                                if($ratiox > $ratioy)
                                                                                {
                                                                                        $new_height = round($img_height * $ratiox);
                                                                                        $new_width = round($img_width * $ratiox);
                                                                                }
                                                                                else
                                                                                {
                                                                                        $new_height = round($img_height * $ratioy);
                                                                                        $new_width = round($img_width * $ratioy);
                                                                                }                                                                               
                                                                        }
                                                                        $cropx = $new_height - $maxheight;
                                                                        $cropy = $new_width - $maxwidth;
                                                                       
                                                                        imagecopyresampled($sprite, $image, 0, 0, 0, 0, $new_width, $new_height, $img_width, $img_height);
                                                                        imagedestroy($image);
                                                                       
                                                                }
                                                               
                                                               
                                                                $img_filepath = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.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.
                                                        echo '<span style="color:red">Error occurred:</span> picture is not readable.' . $article['previewimage']. '<br /> ';
                                                        $article['previewimage'] = $fallback_img;
                                                }                 
                                        }
                                        else
                                        {
                                                //resiziing did not work - we are using the fallback image.
                                                echo '<span style="color:red">Warning:</span> article has no previewimage or sprite is no ressource. ' . $article['previewimage']. '<br />';
                                                $article['previewimage'] = $fallback_img;
                                        }
                                }
                                else
                                {
                                        //we already have the image, no need to resize or crop anything
                                        $article['previewimage'] = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg';
                                }

                /*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="http://yoursite.com/forum/showpost.php?p=' . $article['postid']. '">Xem chi tiết</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
                $article_neu['picture'] = '<a href="http://yoursite.com/forum/showpost.php?p=' . $article['postid']. '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $article['nodeid'] . '" /></a>';
               
                $featured_articles[] = $article_neu;
            }
        }
    }
   
    //Randomize Array
    //shuffle($featured_articles);

        //Debug Messages
        if($debug_modus)
        {
                echo '#articles - featured and databasepull ';
                var_dump(count($featured_articles));
                var_dump(count($database_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="' .$slider_img_filepath. '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();       
}

Change red text color with your forum url;). The result is when you click to preview text or picture it will go to the post that you promoted:cool:

ablaye 11-21-2011 02:18 PM

Quote:

Originally Posted by Mooff (Post 2270188)
@ablaye
I do not experience this behaviour while loading your site.

Yes, it does take quite a while to load the slides. Go to http://www.ndakaru.com and watch the box that says "A LA UNE". It takes a few seconds for the slides to load.
Any idea on how to make the slides load at the same time as the rest of the site?

DoDe 11-21-2011 06:45 PM

Quote:

Originally Posted by Mooff (Post 2270188)
@DoDe
Doesn't happen on our page with opera so without a link to your page it's though to guess what might be happening.

Please take a look on the www.dfgrom.com

I use the standard style to have a better understanding. The vbulletin version is v4.1.8 and the default color of the background should be: #e9e9e9 but it's white. If you look into the source code of the webpage you will notice that there is no white color at all. This is a strange bug only noticed in opera browser.

DoDe 11-22-2011 09:16 PM

SOLVED:
I got it work. I downloaded the newest "jquery-1.7.1.min.js" released yesterday (21st november) and it resolved my problem.
If anyone interested then here is the [ link ].

Loversama 11-23-2011 08:24 AM

This isn't 100% related just to this mod but I thought I'd ask as I have been unsuccessful.

I bought VB CMS just to have this mod.

The United-Forum has the widget as the background, I too am trying to load the widget somewhere else, not using the CMS system, I am trrying to do this:

{vb:raw header}
{vb:raw output} <--- The Slider
{vb:raw navbar}
{vb:raw toolbar}

The widget does not load, I know its abit of a noobie question, but I am lost lol

Thanks in Advanced ^____^

DoDe 11-23-2011 10:33 AM

Quote:

Originally Posted by Loversama (Post 2271081)
This isn't 100% related just to this mod but I thought I'd ask as I have been unsuccessful.

I bought VB CMS just to have this mod.

The United-Forum has the widget as the background, I too am trying to load the widget somewhere else, not using the CMS system, I am trrying to do this:

{vb:raw header}
{vb:raw output} <--- The Slider
{vb:raw navbar}
{vb:raw toolbar}

The widget does not load, I know its abit of a noobie question, but I am lost lol

Thanks in Advanced ^____^

I would first try this tip: https://vborg.vbsupport.ru/showthrea...07#post2222907

Loversama 11-23-2011 11:16 AM

Quote:

Originally Posted by DoDe (Post 2271099)

I have had a look, but I don't really understand it, will that allow me to design a secondary header with the widget built into it, rather then using 'Layout Manager' to place my widget.

It would be nice if {raw: output} in any template would show the slider, how/what do I hook to allow my vbcms_page to load the widget inside ;o

PHP Code:

$templater = \vB_Template::create('vbcms_page');
$templater->register('output'$output);
$template_hook['process_templates_complete'] .= $templater->render(); 

Template Name: vbcms_page

Thats my widget settings, and ofc {raw: output} inside of vbcms_page.

karlm 11-23-2011 10:38 PM

Working good on my 4.1.8 :)

Webbstre 11-24-2011 05:31 AM

I'm just going to echo loversama and repeat that I'm trying my best to get the header to who up inside my header, site-wide. I've followed everything mentioned here but I'm just stumped. I've got the widget loaded into a plugin, it loads on process_templates_complete, and this is the bottom three lines of my plugin:

Code:

$templater = vB_Template::create('nivo_slider');
$templater->register('output', $output);
$template_hook['process_templates_complete'] .= $templater->render();

I've also made that template and on any page other than the CMS home I still get this:

Quote:

Fatal error: Class 'vb_Types' not found in /home/user/mysite.com/includes/class_bootstrap.php(549) : eval()'d code on line 78
If I load the CMS home it will load without any error but there is no slider anywhere, as I've removed it from my CMS layout.

PS. If we can get this slider loading site-wide and get the instructions up on this thread in an easy-to-understand manner I'll gladly donate 25 bucks to your site ;)

Loversama 11-24-2011 08:28 AM

Quote:

Originally Posted by Webbstre (Post 2271397)
I've also made that template and on any page other than the CMS home I still get this:
PHP Code:

Fatal error: Class 'vb_Types' not found in /home/user/mysite.com/includes/class_bootstrap.php(549) : eval()'d code on line 78 


I am getting something similar, but my forum is failing to load due to Database Error.

My logs show

PHP Code:

[24-Nov-2011 02:22:37PHP Warning:  Unexpected character in input:  '\' (ASCII=92) state=1 in /home1/******i/public_html/includes/class_bootstrap.php(555) : eval()'d code on line 548 

I am having to manually go through my DB to try and fix this =[

I found that

PHP Code:

($hook vBulletinHook::fetch_hook('process_templates_complete')) ? eval($hook) : false

Is on line 555 of bootstrap, so that kinda shows why its phailing, now to look into that *Sigh*



I really want the slider working nicely, its the whole reason I bought the publishing suite :P

Webbstre 11-24-2011 08:54 AM

Remove the \ from the first of the three lines I listed. That moves you on to the other error.

Loversama 11-24-2011 09:24 AM

Quote:

Originally Posted by Webbstre (Post 2271430)
Remove the \ from the first of the three lines I listed. That moves you on to the other error.

Ahh, I did that, didnt get my old Error anymore but I still get a Database problem, nothing showed up in the logs though..

So lost untill Mooff shares his infinite wisdom on how they managed to do it :P

Webbstre 11-24-2011 09:56 AM

Also lost :P I'm serious about a donation though.

Mooff 11-25-2011 04:28 PM

Just a quick note to that vb_Types error, that is this line:

Code:

$article_type = vb_Types::instance()->getContentTypeID("vBCms_Article");
For our board the article content type id is 18. That might be different for your board, check your database and then change it to the number like this
Code:

$article_type = 18;
But that aside if you do want to use it in the cms anyway, why don't you use the php-eval content type (to have that in your content selector you need to activate html for your usergroup, yeah that is confusing)? Or create a bunch of subsections where you want to have it?

That template way is for sites not in the cms, like forumhome or external php files (files like this: http://www.united-forum.de/external/.../membermap.php - in the framework using the template system, but link leads to a php file, no slider on that example though).


edit: btw. you might want to change the variable name $output to something else in a global plugin. That might colide with $output variables vbulletin is using. Rename it everywhere to $slider_output or something.

DoDe 11-26-2011 12:01 PM

Strange thing now happens with my slider.
In debug mode I receive this message:

PHP Code:

DEBUG MODE is ON
slider_img_filepathslider
width950 height390 
Strech 
or Crop
show_articles_without_imagebool(false
fallback_imgslider/uf_fallback_slider.png 
#img: 10 
description_length95 
directory 
/var/www/mnt/nfs03/nfs2/html/pro/dfgrom.com/root
Error occurred
picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=64&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=59&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=58&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=56&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=41&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=40&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=36&cid=24
 #articles - featured and databasepull int(7) int(7) 


The permissions in the cms permissions section are:
www.dode.dfgrom.com/permissions.JPG
The slider folder is 0777.
GD library is installed.

Any ideas?

Mooff 11-28-2011 01:35 AM

manually opening one of your attachment links gives me an auth box - the slider will see the same and therefore cannot read that attachment.

DoDe 11-28-2011 06:02 AM

thanks,
that was the problem :up:

Loversama 11-28-2011 07:35 AM

Quote:

Originally Posted by DoDe (Post 2272098)
Strange thing now happens with my slider.
In debug mode I receive this message:

PHP Code:

DEBUG MODE is ON
slider_img_filepathslider
width950 height390 
Strech 
or Crop
show_articles_without_imagebool(false
fallback_imgslider/uf_fallback_slider.png 
#img: 10 
description_length95 
directory 
/var/www/mnt/nfs03/nfs2/html/pro/dfgrom.com/root
Error occurred
picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=64&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=59&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=58&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=56&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=41&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=40&cid=24
Error occurredpicture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=36&cid=24
 #articles - featured and databasepull int(7) int(7) 


The permissions in the cms permissions section are:
www.dode.dfgrom.com/permissions.JPG
The slider folder is 0777.
GD library is installed.

Any ideas?



Quote:

Originally Posted by DoDe (Post 2272640)
thanks,
that was the problem :up:

I have got to that bit now also!

Did you get it working? ;o

DoDe 11-28-2011 12:08 PM

Well in my case I had that problem due to the .htaccess on the website. I'm at the stage of making my website and I don't want anyone else to see it online till it's finished and that's why I've put the .htaccess file (you know, no one can access the website or any file on the server without entering the login and password which are configured in the .htaccess file). To check the proper functionality I removed during the test that file and everything started to work properly.

If that's not your case then I suggest looking into the cms permissions of "Can Download Attachments" for unregistered users.
Try clearing the system cache in the maintenance tab after adding an article.
Check the folder where you store the slider files and see if it's attributes are 0777.

karlm 11-28-2011 06:24 PM

I wish to make use of this in different areas (categories) of the site, I've followed the instructions on how to do that from the FAQ.
I made a separate folder and gave it 777 permissions - it reflected the standard logo. However, once I add the code from the FAQ for categories....

Code:

    node.publishdate < '. vb::$db->sql_prepare($time) .' AND
        category.categoryid IN ( 9 )
        GROUP BY node.nodeid

It stops working entirely and shows only a blank slate.

Coolbluelogo 11-28-2011 10:53 PM

Quote:

Originally Posted by Loversama (Post 2272651)
I have got to that bit now also!

Did you get it working? ;o

I'm also having this issue.

Error occurred: picture is not readable.<link>

However, when I manually open the link, the image is displayed...anyone know what the problem is?

Maybe a bug in the latest release?

intruder 11-29-2011 05:35 AM

Is there any way to add the text below the image in the slideshow?
http://alturl.com/p6fws

Thanks

Loversama 11-29-2011 07:45 AM

Quote:

Originally Posted by DoDe (Post 2272702)

If that's not your case then I suggest looking into the cms permissions of "Can Download Attachments" for unregistered users.
Try clearing the system cache in the maintenance tab after adding an article.
Check the folder where you store the slider files and see if it's attributes are 0777.

Well I can see its not the .htaccess file, and I have also tried what you have suggested but I am still getting the same issue.

The attachments look like this:

PHP Code:

????JFIF``??C          $.' ",#(7),01444'9=82<.342??C       2!!22222222222222222222222222222222222222222222222222????"??      ?ĵ}!1AQa"q2???#B??R??$3br?     %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz???????????????????????????????????????????????????????????????????????????      ?ĵw!1AQaq"2?B????    #3R?br? $4?%?&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz?????????????????????????????????????????????????????????????????????????? ?椄???{?$@?+f?Q???? 

Well theres lots more, but I know thats the Images code stuffs, so I might be like that...

But I have checked permissions ect, refreshed the cache ect..

DoDe did you actually get it working then? ;o


All times are GMT. The time now is 07:44 PM.

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.02198 seconds
  • Memory Usage 2,050KB
  • 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
  • (17)bbcode_code_printable
  • (1)bbcode_html_printable
  • (7)bbcode_php_printable
  • (12)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