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)

clutchthese 08-31-2011 12:21 AM

Quote:

Originally Posted by The Rocketeer (Post 2239854)
Easy, Click Edit on the CMS > Widgets> Slider Widget. See the Template Name below? Copy it and then search for it in Template Search, Then Copy the contents of that Template, Create a new Template with similar name title and then add like _slider at the end), Copy everything to it and then edit out the parts you need. IMO, Just keep the ".raww" and delete all the other <div>'s surrounding it. Done! :up:



@ Mooff - my questions when you get time please :o
:up:

You sir, are a genius. :)

I did it!

And i love this slider! Thank you very much!

Scalemotorcars 08-31-2011 09:12 PM

Thank you sir. Seems that the image cache is back. Ill let you know if that gremlin pops up again... :)

zairafusco 09-02-2011 09:05 PM

@Moof
great work, thank you so much

i wonder how can i change the code just to show the last n articles ordered by date (descending)

thank you again for your work and your support

The Rocketeer 09-03-2011 03:51 AM

1 Attachment(s)
Quote:

Originally Posted by clutchthese (Post 2240210)
You sir, are a genius. :)

I did it!

And i love this slider! Thank you very much!


No Problem Bud.. :up:



For those of you looking to make it look much like Mooff's site (with no background box)

Try this

Create a New Template called

Code:

vbcms_widget_execphp_page_nobackground
Then replace all the code with just

Code:

{vb:raw output}
Then Save



No Go to, CMS > Widgets > Slider Then edit the template line and put

vbcms_widget_execphp_page_nobackground

And maybe set the cache to 9000 for best performance?

Should be done, :p Have a look at the attachments below:up:

Mooff 09-03-2011 09:18 AM

Quote:

Originally Posted by zairafusco (Post 2241324)
@Moof
great work, thank you so much

i wonder how can i change the code just to show the last n articles ordered by date (descending)

thank you again for your work and your support

Sorry, must have forgot to add this one into the FAQ:
https://vborg.vbsupport.ru/showpost....&postcount=120

No value sorting -> ordered by date descending.

@ The Rocketeer
This was kinda already in the FAQ (not title version), added your version anyway, the attachments might make it clearer. =)

zairafusco 09-03-2011 09:33 AM

@Mooff (double 'f', sorry i misreaded before!)

i had already read that but i was uncertain if it was what i needed.. now i'm sure, so i'll put that in my code, thank you again!

The Rocketeer 09-03-2011 12:42 PM

Quote:

Originally Posted by Mooff (Post 2241460)
@ The Rocketeer
This was kinda already in the FAQ (not title version), added your version anyway, the attachments might make it clearer. =)

Thanks Mooff. :) Yea I know, the CMS is a disaster, and on top of that a lot of staff are leaving too. But I'm Hoping for 417 to fix some issues tho. No miracles lol

By the way, checkout this guy's CMS http://www.nationofblue.com/

Maybe it'll give you a good idea for your own site, and also the slider the guy is using looks really fast and a lot more professional, Not sure what its name is, (looks a lot like Front Page Content Slider, but feels a lot different) Any chance you might deem using it worth using instead?

Thanks for everything and All the best Mooff. :)

Mooff 09-03-2011 01:53 PM

I currently do not see the need to change the slider engine. Nivo is very powerful and for me really fast in chrome, opera and firefox.

In addition it is highly customizable. It can look like that:
http://nivo.dev7studios.com/demos/4/ (thumbnails)
http://www.songoperated.com/ (background version)

But well my plugin mainly provides the bridge between vb4-articles and the slider. What the slider does look like is up to the user.

w3rk3d 09-04-2011 02:19 AM

Nice mod! I've installed it, but I'm really hoping future updates will address how this script slows the page loading. I'm guessing it's because there's 100 KB of JS that needs to download?

apaydin2148 09-04-2011 08:27 PM

how can I create a new php-widget? I can't find it.

zairafusco 09-06-2011 10:52 AM

ok... maybe i missed something but i tried to have two instances of the slider
(nb. as you told me in my previuos help request i changed the part of code about the selection.. i jut need articles by date)

so 1) i create a second widget 2) edited the widget (changes also the the DIV id, the .css path and also doubled the .js file trying to have 2 indipendent things)

at this point everything was fine, i had 2 sliders on the same page, each with a different .css customization

but obviously i wanted them to be linked to 2 different CMS sections, so i added the code AND.. to the SELECT, and the correct section ids and ...

that didn't wok, it seems some kind of conflict issue (if i remove one slider the other works correctly) ..

the problem is: the second slider (say they are in the navbar, so the first on the top with section'a' set and the second right under with the section 'b') get "confused" mixing the articles of the sections a and b (precisely:it shows the only article of section 'a' and the first one of section 'b' which has 2 articles).. i think could be related to the result of the first SELECT, maybe if it possibile to have the second select starting from zero.. i event ried to rename all the variables but the result is still the same

any help?

thanks for your support

YkudzA 09-06-2011 11:37 AM

sorry for off but I`m glad to see C&C staff there :)

sensimilla 09-06-2011 12:29 PM

Thanks for this great addon.

I ve read several QA here and still I cant find why the slider displays only default uploaded image.

Permissions and path checked and rechecked..

The attachments are not transformed into png btw..

Any ideas ?

Mooff 09-06-2011 01:14 PM

@YkudzA
Great to see you too. :) Big thanks for the donation.

@zairafusco
Can you link me to your site where the sliders are installed?
As a guess i would say you are using the same folder for both sliders and therefore it does overwrite the pictures. Can you confirm that the captions and descriptions are correct and the images are not?
If that is the case i have two solutions for you:
a) use different folders
b) use this (browser cache issue) fix: https://vborg.vbsupport.ru/showpost....&postcount=195

@w3rk3d
I don't see a page load slowdown on our site. Since we are into page speed a lot (see the sprite addon) i'm very curious where that problem might come from. If it really is the nivo slider framework we will switch the engine. But as of right now i can't reproduce that behaviour and in addition the nivo slider is used a lot on the internet, so i would assume their support forum beeing flooded if it does affect loading times.

@sensimilla
Please check the last FAQ question and send me the debug.

@apaydin2148
you need to have the suite and cms active, then in the acp it's in the cms->widget->new_widget section

sensimilla 09-06-2011 01:30 PM

Thanks for your fast response.. it says
Code:

DEBUG MODE is ON!
slider_img_filepath: /var/www/sites/stylwolny.pl/public/slider/
width: 500 height: 250
show_articles_without_image: bool(false)
fallback_img: /var/www/sites/stylwolny.pl/public/slider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /var/www/sites/stylwolny.pl/public
Error occurred: imagejpeg failed. http://www.stylwolny.pl/slider/palikotvsholdys.png
directory: /var/www/sites/stylwolny.pl/public/var/www/sites/stylwolny.pl/public/slider/slide_0.jpg#articles - featured and databasepull int(1) int(1)


Mooff 09-06-2011 02:55 PM

change
$slider_img_filepath: '/var/www/sites/stylwolny.pl/public/slider/';

to
$slider_img_filepath: 'slider/' ;

zairafusco 09-06-2011 06:57 PM

@Moof

i followed your hint about different folders..it's almost ok but...
i added also (trying everything) a static slider (slider 3) and now slider 1 and slider 2 (dynamic) are linked to the right sections but instead of articles text they both get the static text of slider 3..

if i remove slider 3 i have the same problem.. the sliders show both the same text (slider 1 articles)
NB. but the link to the article is correct (clicking on the image thoug, the caption show only the slider 3 href)

link:
www.dogmylife.com/beta

thank you not only for your mod but for the great support (and fast!)

HERE THE CODE OF SLIDER 1



//////////////////////////////////////////////////////////////////////////////////////////////////////////SLIDER 1
// 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 = 'nivo1/';

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

//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 = 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 ( 125)


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)
{

//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> <p style="text-align:right"><a href="content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">Leggi tutto</a></p>';
$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="slider1" 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() {
$("#slider1").nivoSlider();
});
</script>
</div>
';
$output = $output_bits;

if($debug_modus === false)
{
ob_end_clean();
}

zairafusco 09-06-2011 07:35 PM

//////////////////////////////////////////////////////////////////////////////////////////////////////////SLIDER 2
// 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 = 'nivo2/';

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

//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 = 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 ( 129)

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)
{

//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> <p style="text-align:right"><a href="content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">Leggi tutto</a></p>';
$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="slider2" 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() {
$("#slider2").nivoSlider();
});
</script>
</div>
';
$output = $output_bits;

if($debug_modus === false)
{
ob_end_clean();
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////SLIDER 3

<link rel="stylesheet" href="nivo3/nivo-slider.css" type="text/css" media="screen" />
<link rel="stylesheet" href="nivo3/nivo-slider_uf_theme.css" type="text/css" media="screen" />
<div style="height:250px;">
<div id="wrapper">
<div class="slider-wrapper theme-uf">
<div class="ribbon"></div>
<div id="slider3" class="nivoSlider">
<a href="http://consortium.stormspire.net"><img src="bgheader/bgheader1.jpg" alt="" title="#htmlcaption1" /></a>
<a href="http://consortium.stormspire.net"><img src="bgheader/bgheader2" alt="" title="#htmlcaption2" /></a>
</div>
<div id="htmlcaption1" class="nivo-html-caption">
<b>First slide..</b> </ br> testing.. <a href="http://consortium.stormspire.net">read more</a>
<div id="htmlcaption2" class="nivo-html-caption">
<b>Second slide..</b> </ br> testing.. <a href="http://consortium.stormspire.net">read more</a>
</div>
</div>

</div>
<script type="text/javascript" src="' nivo3/'jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="nivo3/jquery.nivo.slider.pack.js"></script>
<script type="text/javascript">
$(window).load(function() {
$("#slider3").nivoSlider();
});
</script>
</div>

Mooff 09-07-2011 11:14 AM

I think this is the problem:
Code:

<div id="htmlcaption1" class="nivo-html-caption">
<b>First slide..</b> </ br> testing.. <a href="http://consortium.stormspire.net">read more</a>

You probably have multiple divs with the id htmlcaption1.

Please try this:
replace
Code:

                $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>';

with
Code:

          $article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
          $article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#'. $article_neu['htmlcaptionname'] . '" /></a>';

in all automated sliders

zairafusco 09-07-2011 05:24 PM

@Moff
ok!!! you're great..
btw...what do you think about my customization? (i like it .it's still in progress)

thank you again

ENZO-F 09-08-2011 05:09 PM

Quote:

Originally Posted by Mooff (Post 2242623)
change
$slider_img_filepath: '/var/www/sites/stylwolny.pl/public/slider/';

to
$slider_img_filepath: 'slider/' ;

I have installed this and configured it but I am only able to see the fallback image.

Debug:
Code:

DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /home/forum/public_html/forums
Error occurred: picture is not readable.slider/uf_fallback_slider.png
Error occurred: picture is not readable.slider/uf_fallback_slider.png
#articles - featured and databasepull int(2) int(4)


Mooff 09-08-2011 06:11 PM

That's everything you get for debug? Nothing more?

Can you link me to your site?

ENZO-F 09-08-2011 06:27 PM

Quote:

Originally Posted by Mooff (Post 2243506)
That's everything you get for debug? Nothing more?

Can you link me to your site?

Yes, that is the full output.
http://www.nextgenupdate.com/forums/content/

There is still work being done to the CMS.

Kr33p3r 09-09-2011 03:00 AM

Same as above!

Hi there!

Everything works, except it won't pull the image!

I've checked the CMS permissions and its set to allow download of attachments to everyone.

Help!

Thanks!

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


Code:

DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /home/straleyw/public_html/cp/forums
Error occurred: picture is not readable.slider/uf_fallback_slider.png
#articles - featured and databasepull int(1) int(1)


Gamelobby 09-09-2011 08:58 AM

Ok so im confused...

I installed & i see UF image, but where am i supposed to put images so they slide.!?

Does this pull from a forum section or thread..?
OR
Do i just add images to the slider folder on my server.? (that would actually be better for me. :))

Mooff 09-09-2011 09:28 AM

Seems like error messages are suppressed in your php settings.

Some questions for you guys then:
- Is the slider folder writeable for your webserver?
- Do you have the php GD libary installed?
- Is allow_url_access set to false in your php settings?

@Gamelobby
The slider does pull your article preview images and automatically resizes and saves them to the slider folder.

Kr33p3r 09-09-2011 04:14 PM

GD is installed.


Code:

GD Support        enabled
GD Version        bundled (2.0.34 compatible)
FreeType Support        enabled
FreeType Linkage        with freetype
FreeType Version        2.2.1
GIF Read Support        enabled
GIF Create Support        enabled
JPG Support        enabled
PNG Support        enabled
WBMP Support        enabled
XPM Support        enabled
XBM Support        enabled

I made everything 777 just to test:

Code:

drwxrwxrwx  2 straleyw straleyw 4.0K Sep  7 17:39 ./
drwxr-xr-x 31 straleyw straleyw 4.0K Sep  7 17:39 ../
-rwxrwxrwx  1 straleyw straleyw  90K Sep  7 17:39 jquery-1.6.1.min.js*
-rwxrwxrwx  1 straleyw straleyw  16K Sep  7 17:39 jquery.nivo.slider.pack.js*
-rwxrwxrwx  1 straleyw straleyw 1.5K Sep  7 17:39 nivo-slider.css*
-rwxrwxrwx  1 straleyw straleyw 1.8K Sep  7 17:39 nivo-slider_uf_theme.css*
-rwxrwxrwx  1 straleyw straleyw 6.3K Sep  7 17:39 nivo_slider_sprite.png*
-rwxrwxrwx  1 straleyw straleyw  25K Sep  7 17:39 uf_fallback_slider.png*

This allow URL?

Code:

allow_url_fopen        Off        Off
allow_url_include        Off        Off

I can't tell is this is using fopen or not.

Gamelobby 09-09-2011 05:01 PM

Quote:

Originally Posted by Mooff (Post 2243837)
@Gamelobby
The slider does pull your article preview images and automatically resizes and saves them to the slider folder.

So i cant control what it shows outside of what articles are posted.?

This basically replaces articles (& makes them better), rather than adds to the front page.

I dont normally add images to the preview, but the CMS automatically pulls an image from the article.. Can i have it pull the same image.? (Not sure, but it's not doing that now)

It seems like it is going to work really well i just need to tweek it to get it working correctly. :D

Mooff 09-09-2011 06:59 PM

@Kr33p3r
at this point the slider is using fopen:
$imageinfo = getimagesize($article['previewimage']);

@Gamelobby
I'm not sure i understand what your question is.
This addon provides a bridge between vb4 articles and the nivo slider. Therefore it is an article slider widget.
The image which the CMS automatically pulls from the article is used for the slider.
If it doesn't right now do that in your case please refer to post 227.

Kr33p3r 09-09-2011 09:32 PM

Ok I have allowed fopen

Code:

allow_url_fopen        On        On
Sadly,

Code:

DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /home/straleyw/public_html/cp/forums
Error occurred: picture is not readable.slider/uf_fallback_slider.png
#articles - featured and databasepull int(1) int(1)


Mooff 09-09-2011 09:57 PM

Please try switching allow_url_include to ON aswell. It's got to be one of those two.

Kr33p3r 09-09-2011 10:36 PM

Same result, sadly.

allow_url_include On On

Code:

DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /home/straleyw/public_html/cp/forums
Error occurred: picture is not readable.slider/uf_fallback_slider.png
#articles - featured and databasepull int(1) int(1)


The Rocketeer 09-10-2011 01:15 AM

1 Attachment(s)
Quote:

Originally Posted by Kr33p3r (Post 2244094)
Same result, sadly.

allow_url_include On On

Code:

DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /home/straleyw/public_html/cp/forums
Error occurred: picture is not readable.slider/uf_fallback_slider.png
#articles - featured and databasepull int(1) int(1)


Hey Kr33p3r, I see you are having a problem with the fallback or source image, I had the same issue, cant remember how I solved it but might be something in the first few pages.

Anyway, I just visited your site and I wanted to ask. Can you share with us the code / edits that makes the articles appear so neatly on your CMS? Inside the green line below ?

https://vborg.vbsupport.ru/attachmen...1&d=1315620875

I have been long waiting for such a nice flow, and I think me and a lot of others using the vbulletin CMS would certainly benefit from having it.

Edit: not trying to steal your code, just the way your articles are displayed on the home page / blog roll. You know all images nicely at the left, and the info on the right. It looks perfect!

Gamelobby 09-10-2011 03:56 AM

1 Attachment(s)
@ Rocketeer..
That looks like the default CMS design..!?
You dont need a slider for that.



Quote:

Originally Posted by Mooff (Post 2244052)
@Gamelobby
I'm not sure i understand what your question is.
This addon provides a bridge between vb4 articles and the nivo slider. Therefore it is an article slider widget.
The image which the CMS automatically pulls from the article is used for the slider.
If it doesn't right now do that in your case please refer to post 227.

Quote:

Originally Posted by Mooff (Post 2243837)
Seems like error messages are suppressed in your php settings.

Some questions for you guys then:
- Is the slider folder writeable for your webserver?
- Do you have the php GD libary installed?
- Is allow_url_access set to false in your php settings?

@Gamelobby
The slider does pull your article preview images and automatically resizes and saves them to the slider folder.

I'm not sure, how/where do i check this..? (is it in the widget.?)

Here is what i found.. (this part is untouched from what you have above, that we are supposed to put in php widget)
Code:

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

}


Here is what i get..
The UF image with my article text:
https://vborg.vbsupport.ru/attachmen...1&d=1315630872



ALSO..
I just noticed that when i click on an image it takes me to the wrong url.. its not showing the"forum" folder in the path.?
Code:

http://www.mysite.com/content.php?r=251
Should be:
Code:

http://www.mysite.com/forum/content.php?r=251
Could that be part of the problem.?

The Rocketeer 09-10-2011 06:41 AM

Quote:

Originally Posted by Gamelobby (Post 2244145)
@ Rocketeer..
That looks like the default CMS design..!?
You dont need a slider for that.

Nope, That's not the default CMS design.
I was talking about the article display design he had. Its custom.

I am not asking about the slider :confused: if you had read my post carefully I said I already had the slider installed :( (one of the first installs btw) and that others who are having the same issues as I had should look back in the first few pages

Anyhow to the OP, I am just wanting to know about his article display design. Go look at the default vB article layout, its messed up compared to his. Look at the articles 1x1 in a blog roll image above, examine the area I placed in Green.

Mooff 09-10-2011 07:26 AM

That doesn't look like a vb4-cms at all. Judgeding from the code i severly doubt it is one.

@Gamelobby
The wrong link to the articles has nothing to do with where the slider wants to save the images. Per default i'm asuming the content.php resides in the main http folder and not in a subfolder. Anyway, for that to work correctly

search in the php widget code
Code:

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

and replace with this code
Code:

                //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="/Forum/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">read on</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $i ;
                $article_neu['picture'] = '<a href="/Forum/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $i . '" /></a>';


As for the other question why the images do not show up. Can you please post the debug messages the slider puts out in debug mode?
As for checking how to find out whether fopen/ allow_url_open is active or not. I would have to google that aswell. Best is to ask your techadmin, since he is the guy who would need to activate it.

@Kr33p3r
I'll try to come up with a version on monday which pumps out a bit more debug to see what is going on there. Kinda lost right now.

Gamelobby 09-10-2011 07:32 AM

Yea, I meant it looks like just a default CMS layout. (1 Column & Sidebar) He just has articles on the left, & sidebar on the right... as far as i can tell. (If it's not default we can easily make that layout, cant we.?)

That's why i said you dont need a slider for that.
I knew it wasn't the slider. lol

Gamelobby 09-10-2011 07:35 AM

Quote:

Originally Posted by Mooff (Post 2244179)
@Gamelobby
The wrong link to the articles has nothing to do with where the slider wants to save the images. Per default i'm asuming the content.php resides in the main http folder and not in a subfolder. Anyway, for that to work correctly

search in the php widget code
Code:

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

and replace with this code
Code:

                //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="/Forum/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">read on</a>';
                $article_neu['htmlcaptionname'] = 'htmlcaption' . $i ;
                $article_neu['picture'] = '<a href="/Forum/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $i . '" /></a>';


As for the other question why the images do not show up. Can you please post the debug messages the slider puts out in debug mode?
As for checking how to find out whether fopen/ allow_url_open is active or not. I would have to google that aswell. Best is to ask your techadmin, since he is the guy who would need to activate it.

Linksd are fixed. Thanks.



How do i do Debug mode.?
&
Who is my techadmin.? (Is that my hosting.?)

Mooff 09-10-2011 07:38 AM

Designwise it is possible, but it's not easy to force the vb4-cms to look decent. :P

Your techadmin is the guy who does all the coding on your board. Judgeding by your question you are. :P

Please set the slider to debug mode (last FAQ question) and post the output, something might show up what can help us to solve your problem.

Gamelobby 09-10-2011 07:51 AM

Yup i guess that would be me. lol


Here is what i got.
Code:

Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/Forum/slider/slide_0.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 163
Error occurred: imagejpeg failed. http://image.gamespotcdn.net/gamespo...4416_embed.jpg
directory: /home/content/08/4856008/html/gamelobby/Forum/Forum/slider/slide_0.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/Forum/slider/slide_1.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 163
Error occurred: imagejpeg failed. http://l.yimg.com/a/p/sp/tools/med/2...1314751955.jpg
directory: /home/content/08/4856008/html/gamelobby/Forum/Forum/slider/slide_1.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/Forum/slider/slide_2.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 163
Error occurred: imagejpeg failed. http://l.yimg.com/a/p/sp/editorial_i...ch_of_fish.jpg
directory: /home/content/08/4856008/html/gamelobby/Forum/Forum/slider/slide_2.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/Forum/slider/slide_3.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 163
Error occurred: imagejpeg failed. http://s1.wp.com/wp-content/themes/v...ogo-shield.png
directory: /home/content/08/4856008/html/gamelobby/Forum/Forum/slider/slide_3.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/Forum/slider/slide_4.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 163
Error occurred: imagejpeg failed. http://cache2.allpostersimages.com/p...onto-field.jpg
directory: /home/content/08/4856008/html/gamelobby/Forum/Forum/slider/slide_4.jpg



All times are GMT. The time now is 08:48 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.03346 seconds
  • Memory Usage 2,023KB
  • 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
  • (23)bbcode_code_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