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)

wombycat 10-16-2011 07:12 AM

This is a great mod!

Is there a way to control which attachment is displayed? I have an image I want the slider to use for each article as I write them, though I don't want to display the slider image in the article itself. What i have been doing is adding the attachment to the article though not displaying it in the article which works fine. The problem is that when I add an image I do want displayed in the article but not in the slider it takes precedence over the old slider image and is displayed in the slider.

Is it possible for the slider to pull say an image with a particular name? So that the slider always looks for a imaged named 'slider.png' and pulls that for the slider as opposed to the first image in the article?

bintoro 10-16-2011 12:50 PM

Please excuse my noob question.

I install the slider and it's work in the header of frontpage CMS.

The small display of information about the article is display in the bottom area. However, the picture is not showing at all. All the 5 article in spider is showing "uf_fallback_slider.png"

Does it means that my article is not having any picture. I normally include picture by using url reference only.

After that, I upload picture to my article. However, this picture is still not show in the slider too.
My site: http://www.komunitasparfum.com

Any advise to repair it ???? Thanks in advance.

Mooff 10-19-2011 12:50 PM

@bintoro
please go through the faq in the second post.
Your site isn't loading for me - i'm getting a 500 internal server error when trying.

@wombycat
Then you do not need the resizing part. Just manually upload the slider-images you want to show in your slider-img-filepath-folder and change the following code (untested):
Code:

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

to
Code:

$filename = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg';
if (file_exists($filename))
{$article['previewimage'] = $filename;}
else
{$article['previewimage'] = $fallback_img;}

What it does:
It does look for a file named slide_342.jpg in your slider folder. Where 342 is your articleID. If that file does exist it is used as the sliderimage. If not the fallback image is used.

If you want to use a different folder manipulate the $filename variable to your needs.

Cheers Mooff

bintoro 10-19-2011 01:37 PM

@Mooff
Thanks for your info. Frankly, I don't understand with 500 internal server error ???
I just check my website and loading is fine.
Mind to recheck once again please....... Thanks.

Zervesa 10-23-2011 03:23 PM

Hi,

I installed the Nivo Slider Widget on my Site.

I write some Articels with Images but the Slider dont show this images.

The Slider shows the articel Title, and the backup Picture, but not the pictures from my articles.

zapiy 10-24-2011 10:10 AM

Can this mod be used to pull images from a folder as apposed from articles and so on?

Valker 10-26-2011 10:53 AM

Hi ! I hope someone can help me ;S

I installed the Slider as said on my page:

http://www.trinitas-gilde.com/content.php

but the article-images do not show up -_-
i checked about the query etc, but its exaclty as Zervesa descibed.

I?ll hope for help xD

Mooff 10-26-2011 01:06 PM

@bintoro
It's loading, but really slow, like 15sec before anything happens for me.

@Zervesa, Valker
please go through the faq in post 2.

@zapiy
it can be used for such a behaviour, but that does need recoding. If you come up with some php-code which cycles through a folder and pulls images i can tell you where to put that.

Valker 10-27-2011 07:23 PM

works fine now thanks :D i failed with the link cause we have a temprary domain (we?ll have an other in a few weeks)

Valker 10-28-2011 10:16 AM

Hi again :P

So i got a question about the "read on".
I want to change it, and seached for this phrase in the data, but found nothing.
I even tried to find the answer by the nivo slider, but there was no explenation.

Do you have a clue bout it ?


All times are GMT. The time now is 11:51 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.02609 seconds
  • Memory Usage 1,767KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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