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 07-21-2011 11:39 AM

0.9.1 (21.07.2011)
  • added $description_length variable
  • reworked description cutting code. Now using a word sensitive substring function. Cutpoint is easier on the eye now.
  • removed some slashes '/' in the code which might have caused pictures not beeing shown
  • changed description title to h2 instead of span - might have a small effect on beeing more seo friendly
  • removed a bug in the image resizing code (code was wrongly placed outside an else condition)


@Morpheus NS
Your issue could be the slashes. Meaning the path ending up at /http/slider//picture.jpg which could break it. Please try 0.9.1.

If that isn't the problem check whether the pictures are saved in the folder you chose and if you can look them up manually in your browser.

Alfa1 07-22-2011 05:53 AM

The new version work much better for me. No more errors and I now see titles and text. No images yet though. If I outcomment the 1st and last line, then I get these errors:

Code:

Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 110

Warning: fopen(http://www.mysite.org/attachment.php?attachmentid=79&cid=18) [function.fopen]: failed to open stream: no suitable wrapper could be found in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 110

Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 110

Warning: fopen(http://www.mysite.org/attachment.php?attachmentid=90&cid=18) [function.fopen]: failed to open stream: no suitable wrapper could be found in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 110

Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 110

Warning: fopen(http://www.mysite.org/attachment.php?attachmentid=93&cid=18) [function.fopen]: failed to open stream: no suitable wrapper could be found in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 110

Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 110

Warning: fopen(http://www.mysite.org/attachment.php?attachmentid=92&cid=18) [function.fopen]: failed to open stream: no suitable wrapper could be found in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 110


Mooff 07-22-2011 09:24 AM

We are using the fopen() function to check whether the file does still exist on the external server before we start our image manipulation.

Seems like url file access is blocked on your server. I don't know whether this is done via your provider or if you can switch it on in your php.ini
http://www.php.net/manual/en/filesys...figuration.php

That would be your first option.

Second option ist to replace this code:
Code:

                    $filehandle = fopen($article['previewimage'], 'r');
                    if(is_resource($filehandle))
                    {
                        fclose($filehandle);

with the curl based file check (your server needs to have cUrl for that.
Code:

                    $can_open_file = false;                   
                    if(strpos($article['previewimage'], 'http://') === false)
                    {
                        $can_open_file = is_readable($article['previewimage']);
                    }
                    else
                    {
                        // initialize a new curl resource
                        $ch = curl_init();

                        // set the url to fetch
                        curl_setopt($ch, CURLOPT_URL, $article['previewimage']);

                        //exclude the header
                        curl_setopt($ch, CURLOPT_HEADER, FALSE);
                       
                        //exclude the body
                        curl_setopt($ch, CURLOPT_NOBODY, TRUE);
                       
                        // return the value instead of printing the response to browser
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);


                        //take the content as a instance
                        //$filehandle = curl_exec($ch);
                        if(!curl_errno($ch))
                        {
                            $can_open_file = true;
                        }
                                             
                        curl_close($ch);
                    }
                    if($can_open_file)
                    {

If that doesn't work you can try to ignore the file_check and see if the GD url access isn't blocked (like fopen() is).
So the third option would be:
Replace
Code:

                    $filehandle = fopen($article['previewimage'], 'r');
                    if(is_resource($filehandle))
                    {
                        fclose($filehandle);

with
Code:


                    if(true)
                    {


If that doesn't work i'm out of options.



P.S.: On my testsite i have the curl option running right now.

Alfa1 07-22-2011 05:51 PM

Yes, fopen is blocked on purpose due to the major security risks involved. Curl is active though, so that should work. But for some reason it doesn't. Would you mind checking it out?

Mooff 07-23-2011 08:03 AM

Please check if the folder you specified here:
$slider_img_filepath = 'external/unitedforum/slider/';
is writeable and whether the addon does save slides in there.

Alfa1 07-23-2011 03:01 PM

Its 777 writable, but the addon does not save anything.

Mooff 07-23-2011 03:24 PM

Oh geez i'm so stupid. It doesn't work with attachments right now - i'll fix that bug and post a new version later today.

Alfa1 07-23-2011 03:44 PM

Thanks!

Mooff 07-23-2011 03:50 PM

0.9.2 (23.07.2011)
  • fixed a bug which caused the slider to not find attachements
  • removed the fopen() function. Now checking via a GD function whether given ressource is an image


There you go - code in first post updated.
That should do the trick. =)

SECTalk.com 07-23-2011 07:44 PM

Add-on works insofar as it resizes the images and writes them into the folder. It also displays the little background image. But it won't display anything else.

Any ideas?

When I comment out the first and last lines, same thing. No errors.

Thanks


All times are GMT. The time now is 10:36 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.01427 seconds
  • Memory Usage 1,751KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)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