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 08-15-2011 03:04 PM

edited the same time you made your post.

Quote:

edit: another option would be disableing the image resize process. Then you should make sure that your attachments are allready uploaded in the size the slider does need.
That would be (untested):

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

with
Code:

                if($article['previewimage'] )
                {     
                    //do nothing
                }
                else
                {
                    $article['previewimage'] = $fallback_img;
                    echo '<span style="color:red">Warning:</span> article has no previewimage or sprite is no ressource. ' . $article['previewimage']. '<br />';
                }


Pictures should show up then. But it might look odd if the pictures do not have the right width and height.

Scalemotorcars 08-15-2011 03:11 PM

I figured out a way around the hosts rule so I have it working now without the edit above.

Im sure this has been covered but spare me a few brain cells so I get BTW.. :D

Image re-sizes but stretches. Can it be set to fill the area rather then stretch?

And by the way. Huge thank you for the quick replies. Best mod support Ive ever seen.
:up:

I guess I should add the work around.
Just added a php.ini to the root with this function enabled.

theoutlawed 08-15-2011 05:36 PM

Having 1 small issue. The highlight "dots" for lack of better word that are supposed to be in the top right corner are about 1/3 from the top down and on the right of my slide. Not sure how or why the only changes I've made in the CSS is to height/width and then the # of slides.

http://www.outlawedoffroad.com/content/ is the live example of whats happening.

Any help is appreciated. Love this mod, not I just have to start using pics that will fit it better which for future posts won't be a problem we'll just format/standardize the first pics and it'll be golden. Thanks again.

Scalemotorcars 08-15-2011 10:54 PM

Quote:

Originally Posted by theoutlawed (Post 2233848)
Having 1 small issue. The highlight "dots" for lack of better word that are supposed to be in the top right corner are about 1/3 from the top down and on the right of my slide. Not sure how or why the only changes I've made in the CSS is to height/width and then the # of slides.

http://www.outlawedoffroad.com/content/ is the live example of whats happening.

Any help is appreciated. Love this mod, not I just have to start using pics that will fit it better which for future posts won't be a problem we'll just format/standardize the first pics and it'll be golden. Thanks again.

Look at the CSS, you should see the positioning of the buttons. Since you made it taller you need to move the buttons up. I haven't looked but you should see something with a minus and a number, just add to that number. :up:

Mooff 08-16-2011 11:25 AM

@theoutlawed

Check this post:
https://vborg.vbsupport.ru/showthrea...39#post2233439
(your top value might differ, just try different values till it is in the right place)

@Scalemotorcars
Strechting is on purpose cause fill or cropping the images would look even worse. Best course of action is to use previewpictures for the articles which are near the slider width/height ratio.

Scalemotorcars 08-16-2011 12:06 PM

Thanks :D

I simply made it taller and its looking pretty sharp now. Thanks again for all the help and great mod. :up:

theoutlawed 08-16-2011 02:59 PM

Quote:

Originally Posted by Scalemotorcars (Post 2233933)
Look at the CSS, you should see the positioning of the buttons. Since you made it taller you need to move the buttons up. I haven't looked but you should see something with a minus and a number, just add to that number. :up:

Yup my bad.. Should have looked in the CSS file first.. Saw it in 2 seconds..

Thanks for the assist, 5 second change and BOOM it's perfect again. This mod is one of the best things I've done to my homepage/cms it gives such a clean and professional look to a casual visitor who may see a dozen similar forums.

theoutlawed 08-16-2011 03:00 PM

Quote:

Originally Posted by Mooff (Post 2234134)
@theoutlawed

Check this post:
https://vborg.vbsupport.ru/showthrea...39#post2233439
(your top value might differ, just try different values till it is in the right place)

@Scalemotorcars
Strechting is on purpose cause fill or cropping the images would look even worse. Best course of action is to use previewpictures for the articles which are near the slider width/height ratio.

Thanks Mooff, A+++ loving how the frontpage is starting to look.

WoODoO 08-17-2011 12:21 PM

This error occurred

PHP Code:

DEBUG MODE is ON!
slider_img_filepath: /externo/slider/
width650 height250
show_articles_without_image
bool(false)
fallback_img: /externo/slider/uf_fallback_slider.png
#img: 5
description_length95
directory 
/home/coalizao/public_html
Error occurred
picture is not readable./externo/slider/uf_fallback_slider.png
Error occurred
picture is not readable./externo/slider/uf_fallback_slider.png
#articles - featured and databasepull int(3) int(3) 

Directory perms 777.
allow_url_fopen active.

But slider not appear.

Mooff 08-17-2011 04:34 PM

That is not the full error message is it?


All times are GMT. The time now is 01:41 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.06502 seconds
  • Memory Usage 1,788KB
  • 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)bbcode_php_printable
  • (4)bbcode_quote_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