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 09-10-2011 08:02 AM

And now we know it's not fopen or url_access.
Resizing and everything works (not gonna look too good though given the width/height ratio of the pictures) but the slider can't save the pictures (cause the folder either does not exist or isn't writeable).

change:
//your slider folder - has to be read and writeable
//folder where all slider files are saved
$slider_img_filepath = 'Forum/slider/';
to

$slider_img_filepath = 'slider/'

Gamelobby 09-10-2011 08:32 AM

Quote:

Originally Posted by Mooff (Post 2244193)
And now we know it's not fopen or url_access.
Resizing and everything works (not gonna look too good though given the width/height ratio of the pictures) but the slider can't save the pictures (cause the folder either does not exist or isn't writeable).


change:
//your slider folder - has to be read and writeable
//folder where all slider files are saved
$slider_img_filepath = 'Forum/slider/';
to

$slider_img_filepath = 'slider/'

Should be readable & writable.

Removed Forum/"


*edit*
Works.!!

But my images are WAY stretched out. lol
Now i need to play with the settings, i guess. :D

Kr33p3r 09-10-2011 05:06 PM

Quote:

Originally Posted by Mooff (Post 2244183)
Designwise it is possible, but it's not easy to force the vb4-cms to look decent. :P

Truer words have never been spoken.

Sorry guys, you guys are looking at wordpress, not vBCMS. :D

The vBCMS is here:

http://www.cyberneticpunks.com/forums/content/

I still have the same issue however. It finds the fall back image fine.

Is there additional logging I can turn on?

The Rocketeer 09-11-2011 03:18 AM

Quote:

Originally Posted by Kr33p3r (Post 2244318)
Truer words have never been spoken.

Sorry guys, you guys are looking at wordpress, not vBCMS. :D

The vBCMS is here:

http://www.cyberneticpunks.com/forums/content/

I still have the same issue however. It finds the fall back image fine.

Is there additional logging I can turn on?

Damn you!
for a min there I thought I finally got something :D

Very Nice Design BTW. Wish Anyone could make the vBulletin CMS look half decent. :(

zairafusco 09-11-2011 07:47 PM

i know it sounds stupid but.. i wanted to have a slider without nav buttons and another one without control buttons and... i'm not able to let controls and directions buttons to show and hide editing .css files... i only managed to hide the controls but now i can't make them appear again.. and the arrows.. there's no way to make them disappear....
i'm having some kind of cache troubles of what?
btw i'm running at once 2 sliders on my page (dynamic and static version)

thank you

zairafusco 09-11-2011 08:22 PM

sorry guys.. i must be a bit tired... read the faqs on nivo slider official website and found everything ...just playing with parameters like:

Code:

.nivoSlider({

controlNav:true,
directionNav:false});

and so on..

hope this one can be useful for someone!

thanks

Scalemotorcars 09-12-2011 07:36 PM

Ive been messing with this for some time and I have no problem getting one slider to work on my homepage but Im trying to get another to work in a specific section.

I made a 2nd directory for the slider. So the first is slider/ the 2nd is slider2/ I have all the JS files in both as well as the fall back image.

I made a 2nd widget with and modified the code to save images in slider2/ as well as pull from a specific section.

All fine until it comes to actually seeing the slides. I get the rotation and the correct text but no images. I checked the dir. and its 777.

URL's in the slider are all correct. I click the image and I get the correct page.

Just very stuck as to why no images in the 2nd slider. Any help would be great.

Heres a copy of the widget 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 = 'clientscript/slider2/'; 

//picture width and height !same as in the CSS FILE!
$maxwidth = 700;                                 
$maxheight = 375;   

//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_slider2.png'; 

//hardcoded maximum is 20 - if you want more just ask
$number_of_articles_shown = 10;                               
           
//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: ";
        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,
            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) .' AND
            node.parentnode IN ( 136 )
        GROUP BY node.nodeid
        ORDER BY node.publishdate
        DESC LIMIT 20');
               
    $database_articles = array();
   
    $i = 0;
    $section_array = array();
    $featured_articles = array();
       
    while($article = vB::$db->fetch_array($article_get))
    {
        $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);

        //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.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();       
}


zairafusco 09-13-2011 04:45 PM

i don't know wha happened.. tried the whole thing from start several times but i'm stuck on this error (and no visible slides..).. the only difference i can get starting over is the line number

Parse error: syntax error, unexpected T_STRING in /web/htdocs/www.dogmylife.com/home/beta/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 24

i really don't know what to do..

thank you

Mooff 09-14-2011 06:42 AM

Most likely you are missing a semicolon in line 24 of the widget php code

that would be line 24
$fallback_img = $slider_img_filepath . 'uf_fallback_slider.png';

what does yours look like?

As for the other problems. I've read them, but unfortunately no time to look into it right now. Another coding projekt on our site keeps me busy right now.

BadgerDog 09-14-2011 11:00 AM

1 Attachment(s)
Installed for testing on 4.1.3 with thanks ... :)

Regards,
Doug

Edit: Un-installed .. didn't work (see pic .. just empty box with date).. thanks anyway for your efforts ...


All times are GMT. The time now is 05:52 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.03456 seconds
  • Memory Usage 1,817KB
  • 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
  • (3)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