View Full Version : vBulletin CMS Widgets - United-Forum Nivo Slider Widget
zairafusco
09-14-2011, 11:01 AM
your support is most appreciated!
unfortunately i can't test your suggestions right now, it'll have to wait until saturday, but for now THANK YOU!
gusto
09-14-2011, 06:05 PM
I need this slider and can't figure it out, can somebody help me?
Mooff
09-14-2011, 08:44 PM
@BadgerDog
You need to insert the code into the php widget. A default php widget with no new code does show the date.
@gusto
Please state which part is unclear in my installation description so i can improve it.
BadgerDog
09-15-2011, 11:16 AM
@BadgerDog
You need to insert the code into the php widget. A default php widget with no new code does show the date.
Thanks ... doh !!! :o
Regards,
Doug
BadgerDog
09-15-2011, 11:28 AM
Is there someplace I can change the actual size of the widget box being displayed?
Not the pic dimensions or text, but the size of the box, if that makes any sense?
Thanks .. :)
Regards,
Doug
GamersChallenge
09-16-2011, 11:18 PM
how do I add this on another page? for example: test.php
daniel_pet
09-17-2011, 05:54 AM
Not the pic dimensions or text, but the size of the box, if that makes any sense?
nivo-slider_uf_theme.css
.theme-uf #slider {
margin:0px auto 0 auto;
width:650px; /* Make sure your images are the same size */
height:250px; /* Make sure your images are the same size */
}
pmflav1
09-18-2011, 09:56 PM
My apologies if this has been answered prior.
How do I change the sped of each slide, I basically want to halve the speed of each slide.
Mooff
09-18-2011, 10:40 PM
@GamersChallenge
In order to use the widget code on a test.php this test.php would have to have access to your vbulletin database. If you have the required files included on your test.php page just add (untested)
echo "$output";
at the end of the widget code and insert it into the test.php file. It should show up then.
@pmflav1
That FAQ question should help you out:
Q: I want to change some nivo slider settings (effects, timings..)
A: An example for timings can be found here:
https://vborg.vbsupport.ru/showpost.php?p=2232204&postcount=132
For other settings please check the nivo slider homepage:
http://nivo.dev7studios.com/#usage
BadgerDog
09-19-2011, 11:58 AM
nivo-slider_uf_theme.css
.theme-uf #slider {
margin:0px auto 0 auto;
width:650px; /* Make sure your images are the same size */
height:250px; /* Make sure your images are the same size */
}
Thanks ... :)
Regards,
Doug
owning_y0u
09-20-2011, 12:10 AM
installed, Thanx Pretty awsome addition way better then a previous mod i was using :-)
+like
GamersChallenge
09-20-2011, 01:53 AM
@GamersChallenge
In order to use the widget code on a test.php this test.php would have to have access to your vbulletin database. If you have the required files included on your test.php page just add (untested)
echo "$output";
at the end of the widget code and insert it into the test.php file. It should show up then.
@pmflav1
That FAQ question should help you out:
I dont understand,
this is test.php file.
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');
define('CSRF_PROTECTION', true);
// change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array('test',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
$navbits = construct_navbits(array('' => 'Terms of Service'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Terms of Service';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('test');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());
?>
this is test template:
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
<title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title>
{vb:raw headinclude}
{vb:raw headinclude_bottom}
</head>
<body>
{vb:raw header}
{vb:raw navbar}
{vb:raw footer}
</body>
</html>
whats next?
Mooff
09-20-2011, 10:52 AM
Bottom of the article you just quoted:
https://vborg.vbsupport.ru/showthread.php?t=228112
Please see this article for help with rendering templates - [vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)
In a nutshell:
a) insert the php code from the first post here
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';
b) register the variable $output
c) update your template so it does print the variable $output
Scalemotorcars
09-20-2011, 04:07 PM
Moff, have you or do you know how to make this work without fopen. I'm not sure how to code it for curl.
My host doesn't like fopen so I'm looking for an alternative. Thanks.
GamersChallenge
09-21-2011, 12:12 AM
after spending hours reading all those tutorials I came up with this... what am I doing wrong?
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');
define('CSRF_PROTECTION', true);
// change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array('test',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
$navbits = construct_navbits(array('' => 'Terms of Service'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'test';
// 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 = 'slider/';
//picture width and height !same as in the CSS FILE!
$maxwidth = 620;
$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 = 7;
//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 ( 163, 158 )
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> <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-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() {
$("#slider").nivoSlider();
});
</script>
</div>
';
$output = $output_bits;
if($debug_modus === false)
{
ob_end_clean();
}
echo "$output";
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('test');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('output', $output);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());
?>
Mooff
09-21-2011, 09:39 AM
@Scalemotorcars
I haven't looked into it.
The options are:
- using fitting images as article images, which do not need to be resized (delete the resizing part then)
- resizing the images via CSS (might break the nivo slider transition effects, not sure about that one) - this also would mean deleting the resizing code
- cURL, which does involve reading through the cURL documentation or googleing for "replace fOpen via cURL"
@GamersChallenge
you can remove echo "$output"; since you are using the template system.
Then in the template you need to write {vb:raw output} somewhere, and that should be it.
GamersChallenge
09-22-2011, 01:19 AM
@Scalemotorcars
I haven't looked into it.
The options are:
- using fitting images as article images, which do not need to be resized (delete the resizing part then)
- resizing the images via CSS (might break the nivo slider transition effects, not sure about that one) - this also would mean deleting the resizing code
- cURL, which does involve reading through the cURL documentation or googleing for "replace fOpen via cURL"
@GamersChallenge
you can remove echo "$output"; since you are using the template system.
Then in the template you need to write {vb:raw output} somewhere, and that should be it.
I think I'm almost there. Getting this error now.
Fatal error: Class 'vb_Types' not found in /home/gamersch/public_html/test.php on line 91
this is line 91:
$article_type = vb_Types::instance()->getContentTypeID("vBCms_Article");
Mooff
09-22-2011, 07:11 AM
Sorry for the question, but i kinda just have to ask: Do you have the vbcms?
Anyway, if you do i'm not exactly sure in which globalclass vb_Types is definded, just look into your database, i think the table is "contenttypes" and check which contenttypeid your articles have.
On our installation it would be
$article_type = 18;
could be different on yours though.
GamersChallenge
09-22-2011, 09:22 AM
Sorry for the question, but i kinda just have to ask: Do you have the vbcms?
Anyway, if you do i'm not exactly sure in which globalclass vb_Types is definded, just look into your database, i think the table is "contenttypes" and check which contenttypeid your articles have.
On our installation it would be
$article_type = 18;
could be different on yours though.
yes I have. I also have the slider working on my home page as a widget with the same code, I'll try yo look into what you said. thanx
Scalemotorcars
09-23-2011, 01:56 AM
Thanks anyway Mooff, I ended up just going with the Content slider. The load times were dragging the homepage down horribly and my host was having an issue with Fopen.
Sage Knight
09-24-2011, 06:41 AM
Hello, everything seems to be working fine except for one thing; the slider images aren't showing in the slider. The slider is working fine, instead the fallback images are showing. Also no images are being saved in the specified folder.
Scalemotorcars
09-24-2011, 03:08 PM
More then likely your host has disabled fopen. You can create an php.ini file enabling it but your host may not like that. If you do a Google search you'll see how.
Sage Knight
09-24-2011, 04:27 PM
Lol, right now I got it working, I just had to clear the CMS cache. But thanks anyway!
Sage Knight
09-30-2011, 05:50 AM
Edit: I cannot seem to remove the frame around the static html version of the slider.
I did follow all the steps mentioned and also renamed the template as;
"vbcms_widget_static_page_nobackground"
And added the same title. Yet it's still not working and the slider isn't appearing.
Fixed :D
Gotta love Mooff :D
hyperviperx99
09-30-2011, 07:24 PM
OK in my site http://www.fliprap.com/content.php I want to know how come the slider feature works, but the article images do not show, only the default image shows. How can I get the Article image to show? I already check the javascript filepath that was mentioned in FAQ and everything is correct. Any suggestions? Please tell me, I really need some serious help!
wombycat
10-01-2011, 01:09 PM
This mod is freaking awesome!!!!!!!
Couple of questions:
1) How do I remove the text from the slider? I would like to have only the images pulled from the articles.
2) Is it possible to have 2 of these on the same page? I have two atm and the 2nd one is coming up as a blank white box, though if I turn the first one off the 2nd one works flawlessly.
EDIT:
I did a debug on the blank slider which gave me this code:
DEBUG MODE is ON!
slider_img_filepath: nivoslider/
width: 190 height: 190
show_articles_without_image: bool(false)
fallback_img: nivoslider/uf_fallback_slider.png
#img: 5
description_length: 0
directory /var/www/virtual/std/andrew.jennings/reactgaming.net.au
#articles - featured and databasepull int(5) int(20)
I don't know if that helps or not. At the moment each slider has it own folder on the server so that i could have the sliders at different sizes and speeds.
Eagerly await your thoughts or ideas :)
Again this is an awesome mod, thank you for taken the time to give this to the community :up:
Kr33p3r
10-02-2011, 06:08 PM
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?
Is there anything else I can do to provide you more information?
Heck, I'd give you shell access if you want it.
Mooff
10-02-2011, 06:19 PM
We are in the final stages of releasing a huge project on our board. I expect that to be done mid next week.
Once we are live i'll answer the questions which came up here in regards to the slider.
P.S.: Thanks for the latest donation. :)
vexxy
10-05-2011, 07:29 AM
Moof, one question, if you have time. Is there a way I can display the slider only on CMS home and not on all article pages?
Mooff
10-05-2011, 11:31 AM
@vexxy different layouts for different cms sections
wombycat
10-05-2011, 09:29 PM
P.S.: Thanks for the latest donation. :)
Most Welcome :)
I had something strange happen to me today. After days of the slider working perfectly, this morning the fall back image was showing. I enables/disabled any different products that I had fiddled with lately though I could not get it to show the correct pulled images. I cleared the cache many times until I went into the 'slider' folder and deleted the images it had pulled previously. Now it works again
Any thoughts on what may have caused that?
site (http://reactgaming.net.au)
owning_y0u
10-06-2011, 06:53 AM
OK in my site http://www.fliprap.com/content.php I want to know how come the slider feature works, but the article images do not show, only the default image shows. How can I get the Article image to show? I already check the javascript filepath that was mentioned in FAQ and everything is correct. Any suggestions? Please tell me, I really need some serious help!
Chmod the pic folder to 0777
owning_y0u
10-06-2011, 07:08 AM
For those that have issues with images not show correctly f.e. Wrong image is placed in the slider.
Make sure that those images are imported to you web server. External images wont be fetched
Mooff
10-07-2011, 02:28 PM
I'll try to answer some questions now, still no time to do some heavy debugging though - we just moved to another server like two days ago and still have to fight some bugs which are included for free with every change. In addition our heavy cms customization is finally ready and live - but that of course also needs some love, polishing and bugfixing.
But it's a nice showcase what can be done with the nivo slider engine. :p
http://www.united-forum.de/news/
Questions:
@hyperviperx99
I think you switched to another mod. Am i right?
@Kr33p3r
Sorry totally forgot about the version with more debug - for starters a small bit to improve that error you are getting:
find this part
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 /> ';
}
replace with
else
{
//resiziing did not work - we are using the fallback image.
echo '<span style="color:red">Error occurred:</span> picture is not readable.' . $article['previewimage']. '<br /> ';
$article['previewimage'] = $fallback_img;
}
@wombycat
1) How do I remove the text from the slider? I would like to have only the images pulled from the articles.
----------------------
quick and dirty:
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider();
});
</script>
replace with
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider({
captionOpacity: 0,
});
});
</script>
2) Is it possible to have 2 of these on the same page? I have two atm and the 2nd one is coming up as a blank white box, though if I turn the first one off the 2nd one works flawlessly.
---------------------
you prolly have included two jquery files on the site. Put the jquery in your headinclude and remove that line from both sliders:
<script type="text/javascript" src="' .$slider_img_filepath. 'jquery-1.6.1.min.js"></script>
@owning_y0u
For those that have issues with images not show correctly f.e. Wrong image is placed in the slider.
Make sure that those images are imported to you web server. External images wont be fetched
That's not the case.
Wrong images showing is due to a browser caching error.
A fix would be here:
https://vborg.vbsupport.ru/showpost.php?p=2239532&postcount=195
Hope i haven't missed a question. Cheers guys.
dvL-den
10-07-2011, 06:06 PM
I don't get it. I have uploaded files and created widget. Edited path and put the widget into layout. Where it should appear as I don't see it anywhere?
I would like to put it on the bottom of forums home. If that is possible?
Please PM me if you have solution for me. Thank you.
wombycat
10-09-2011, 05:51 AM
@wombycat
1) How do I remove the text from the slider? I would like to have only the images pulled from the articles.
----------------------
quick and dirty:
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider();
});
</script>
replace with
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider({
captionOpacity: 0,
});
});
</script>
2) Is it possible to have 2 of these on the same page? I have two atm and the 2nd one is coming up as a blank white box, though if I turn the first one off the 2nd one works flawlessly.
---------------------
you prolly have included two jquery files on the site. Put the jquery in your headinclude and remove that line from both sliders:
<script type="text/javascript" src="' .$slider_img_filepath. 'jquery-1.6.1.min.js"></script>
Hope i haven't missed a question. Cheers guys.
Thank you very much, the support on this is awesome! Donating again :)
wombycat
10-09-2011, 05:57 AM
I don't get it. I have uploaded files and created widget. Edited path and put the widget into layout. Where it should appear as I don't see it anywhere?
I would like to put it on the bottom of forums home. If that is possible?
Please PM me if you have solution for me. Thank you.
Even if the slider does not work/appear the widget should still be there. May sure you have added it to the right layout and that is the layout being used on the home cms page. Once you have the widget box showing any issues can be sorted from reading the question and answers. (https://vborg.vbsupport.ru/showpost.php?p=2221916&postcount=2)
Good luck :)
thecore762
10-12-2011, 05:40 AM
Will this work with vBadvanced?
Mooff
10-12-2011, 11:00 AM
@thecore762
I do not own vb_advanced. Therefore i have no idea.
Since the db_query is build upon the vb4-cms article database/table structure i have to go with "probably not". Maybe an experienced coder who does have vb advanced can clearify on that one.
btw. since i read about cropping and was curious whether this would be hard to do with gd i just checked it out:
(untested)
The catch: The simple version needs your pictures to be bigger than the result. Can be worked around though i think. Without someone actually wanting it i won't check into it more though - simply cause we do not need it right now
anyway, for cropping
find
$img_width = $imageinfo[0];
$img_height = $imageinfo[1];
imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
imagedestroy($image);
replace with
$img_width = $imageinfo[0];
$img_height = $imageinfo[1];
if($img_height > $maxheight AND $img_width > $maxwidth)
{
$cropy = $img_height - $maxheight;
$cropx = $img_width - $maxwidth;
imagecopyresampled($sprite, $image, 0, 0, $cropx, $cropy, $maxwidth, $maxheight, $img_width, $img_height );
}
else
{
imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
}
imagedestroy($image);
(if someone uses this one, please report back to me if it does work - i do not have a testboard right now, so no testing ;) )
charlesr
10-12-2011, 03:59 PM
If you leave my slider (at http://www.bordersdown.net/) going for a while, eventually it goes weird (pics seem out of sync with text or text disappears) and firefox asks you if you want to the stop the script that is running on the page. Anyone else noticed anything like this?
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):
//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
$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 ?
Mooff
10-28-2011, 01:03 PM
Read on is hardcoded,
find this code
$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>';
replace 'read on' there with the phrase you want to have.
Valker
10-28-2011, 01:35 PM
holy...
sry for my stupidity which might have infected the notepad++ search tool o-o dunno why it did not found it.
thx ^_^
Aztlan
10-30-2011, 12:01 AM
I have been trying to make this addon work
I followed your Q/A post and still no luck.
the slider creates the images to the specific folder but somehow can't read them
firebug states this error, see attachment
Mooff
10-30-2011, 12:30 AM
Hi,
i know what the problem is, try these custom settings for your board. That should do the trick.
search and replace
$img_filepath = $slider_img_filepath . 'slide_' . $i . '.jpg';
$success = imagejpeg($sprite, DIR . ($img_filepath[0] != DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '') . $img_filepath);
with
$img_filepath = $slider_img_filepath . 'slide_' . $i . '.jpg';
$success = imagejpeg($sprite, '/home/theborg/www/arcade' . ($img_filepath[0] != DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '') . $img_filepath);
and
//your slider folder - has to be read and writeable
//folder where all slider files are saved
$slider_img_filepath = 'slider/';
with
//your slider folder - has to be read and writeable
//folder where all slider files are saved
$slider_img_filepath = 'community/slider/';
Cheers
Aztlan
10-30-2011, 02:32 AM
hey, that actually fixed my issue.
Thanks for the help :)
warzone sys
10-30-2011, 12:47 PM
Please my friend i need help. I want add slides on vba CMPS, I can't find like add widget php on control panel
warzone sys
10-30-2011, 06:30 PM
please help me friends
Valker
11-01-2011, 03:05 PM
plz stop calling random ppl friends..
here?s mine cp, its in german but i think it?s gonna tell you where to look.
https://vborg.vbsupport.ru/
warzone sys
11-02-2011, 02:23 AM
plz stop calling random ppl friends..
here?s mine cp, its in german but i think it?s gonna tell you where to look.
http://img847.imageshack.us/img847/4475/widgeta.png
Yes man but I use CMPS look
https://vborg.vbsupport.ru/external/2011/11/80.png
The Rocketeer
11-07-2011, 06:16 AM
Hey Mooff, this has stopped working all of a sudden. We are still running the version of vBulletin it was running months ago. But suddenly now all i see is the fallback image! give me a fix please!
charlesr
11-07-2011, 07:36 AM
<a href="http://www.bordersdown.net/" target="_blank">http://www.bordersdown.net/</a> << My slider has changed to showing the 2nd article first.... Weird eh? I haven't changed the slider code, so can I assume I should be really worried about my database?
Can anyone give me any pointers to see why this is happening please?
The Rocketeer
11-07-2011, 07:41 AM
http://www.bordersdown.net/ << My slider has changed to showing the 2nd article first.... Weird eh? I haven't changed the slider code, so can I assume I should be really worried about my database?
Can anyone give me any pointers to see why this is happening please?
I know weird. It also stopped working for me, I just noticed :(
Nice site btw. Only if VB4 would look this good out of the box :)
charlesr
11-08-2011, 09:53 AM
Thanks. It's all standard css/template changes though (plus Tabs advanced and nivo slider) - nothing needs manual maintenance. :)
Mooff
11-08-2011, 02:37 PM
1.1.0 (8.11.2011)
included a "cache" system for pictures which solves a browser cacheing issue and speeds up the slider (on second image creation) -- added some FAQ questions
included a bit more debug messages
new crop function (beta stadium) included
Also 3 new FAQ questions concerning the "cache" system.
@warzone sys
this addon is for the vbcms, not for the vba
@charlesr
the slider uses a value function. If the second article has more comments it can overtake the first one.
@The Rocketeer
please go through the faq and use the debug mode. With the information you have given me i would guess you installed another addon with a jquery file?
Webbstre
11-09-2011, 05:40 AM
This is an awesome mod, and I'm totally hoping I can integrate it into my Header for the entire site. Do you think you could help make this possible? This is where I go wrong:
1- I am trying to put the php code into a plugin, but I'm having trouble figuring out how to make a custom hook to call it when I want.
2-I'm testing by having it load on parse_templates, but that results in this error code:
Fatal error: Class 'vb_Types' not found in /home/user/mydomain.com/includes/class_bootstrap.php(426) : eval()'d code on line 82
I tried switching out that line for the $article_type = 18; in the part of this thread (https://vborg.vbsupport.ru/showpost.php?p=2248413&postcount=266) where you helped GamersChallenge, but, it just threw up another error. My coding skills aren't good enough I suspect.
If I could make this work globally it would be amazing ;)
charlesr
11-09-2011, 08:50 AM
Thanks Mooff!
The Rocketeer
11-11-2011, 10:58 PM
@The Rocketeer
please go through the faq and use the debug mode. With the information you have given me i would guess you installed another addon with a jquery file?
hey mooff, this is the error we are getting. I dont understand why because we didnt change or install anything! it just started to happen last week. :(
DEBUG MODE is ON!
slider_img_filepath: frontpage_nivo_slider/
width: 650 height: 250
show_articles_without_image:
fallback_img: frontpage_nivo_slider/uf_fallback_slider.png
#img: 10
description_length: 95
Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration
The Rocketeer
11-13-2011, 03:44 AM
Hey Mooff, We need some help here to get this working again.
Mooff
11-13-2011, 01:05 PM
Something in your server configuration changed:
Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration
url file access (which is needed for getimagesize() ) to create the new picture isn't available anymore.
The Rocketeer
11-13-2011, 11:27 PM
thanks mooff, I have contacted them but after doing some research it seems its caused by the latest upgrade from php 4? I think this mod might need to be edited to be able to work with the latest php version that has the url file access disabled? have a look here - http://www.learnphponline.com/errors/url-file-access-is-disabled-in-the-server-configuration
:)
Mooff
11-14-2011, 01:21 AM
We are using php 5.3.8 (that's the latest stable release).
Your link doesn't help btw. I'm not using include() anywhere in the code. And i can't rewrite it so that it looks for the files in a local path, cause well, not all of them are stored locally. Preview pictures can be anything from attachement, to local image, to external image.
There *might* be a way getting around allowing url_open, which would be cURL, but finding out how cURL works involves a lot of time. And i'm not even sure it does work and i can't test it since we won't disable the allow_url_open setting on our box anyway.
mmoore5553
11-14-2011, 08:07 PM
I do not know why but no picture is showing up but just the default no picture. Is this pulling inline images or attachements ? I am confused on what it trying to pull or at this point not pull. I have checked the faq and still lost.
jo8jo
11-15-2011, 08:13 AM
Hi, the slider widget works fine for me :up: Great work ;)
One more problem i cannot solve:
I'm using this mod: VBCMS Threads promoted to articles link to forum thread no more article pages (https://vborg.vbsupport.ru/showthread.php?t=247758) to link by clicking "Read more" to the original forum thread - not to the article!
The code in "vbcms_content_article_preview" changes to this:
<vb:if condition="$preview_chopped">
<span class="cms_article_readmore"><a href="{vb:raw vboptions.bburl}/showpost.php?{vb:raw session.sessionurl}p={vb:raw postid}">{vb:rawphrase read_more_phrase} <img src="{vb:stylevar imgdir_cms}/read_more-{vb:stylevar right}.png" alt="{vb:rawphrase read_more_phrase}" /></a>
</span>
</vb:if>
Original code:
<vb:if condition="$preview_chopped">
<span class="cms_article_readmore"><a href="{vb:raw page_url}">{vb:rawphrase read_more_phrase} <img src="{vb:stylevar imgdir_cms}/read_more-{vb:stylevar right}.png" alt="{vb:rawphrase read_more_phrase}" /></a>
</span>
</vb:if>
I want to click on the slider image or preview text and get forwarded to the forum thread - not to the article. I think i need to change the following php codeof the slider widget code to get the effect from above: :confused:
<span>'. $article['previewtext'] .'</span> <a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">More</a>';
$article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
$article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">
I would be thankful for your suggestions :)
blackracoon
11-15-2011, 02:42 PM
Hi Moof,
I have checked through, an image is being generated in the folder /slider if I put an attachment in the article, I'm using the jquery by vbulletin in the clientscripts folder so that there was definately no double ups (it's the correct directory I checked the source and it links correctly). But something just isn't working correctly.. seems like a formatting issue, but we cannot see any of the images or functionality buttons.
The directory is 777, I can see the .css file as per your test in the FAQ's to ensure the directory setting is correct. (img path).
The directory is slider/
I have enabled debugging on the site for viewing to see if anyone else has a clue of what may be going on..
http://www.etozclan.com/vbulletin
I've seen it in action on a few other peoples site it looks very nice, hoping we can get it succesfully configured and running.
- I have also enabled show article with no image so the default image shows, but that also does not work, even though the directory is 777 the directory is accessible and jquery is linked.. it seems.. :(
Regards
Mooff
11-15-2011, 03:21 PM
@jo8jo
this should work (untested code)
search
$article_get = vB::$db->query_read('
SELECT
article.pagetext,
article.previewimage,
node.url,
node.publishdate,
node.parentnode,
replace with
$article_get = vB::$db->query_read('
SELECT
article.pagetext,
article.previewimage,
article.threadid,
node.url,
node.publishdate,
node.parentnode,
search
<span>'. $article['previewtext'] .'</span> <a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">More</a>';
$article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
$article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">
replace with
<span>'. $article['previewtext'] .'</span> <a href="/showthread.php?t=' . $article['threadid'] . '-' . article['url'] . '">More</a>';
$article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
$article_neu['picture'] = '<a href="/showthread.php?t=' . $article['threadid'] . '-' . $article['url'] . '">
@mmoore5553
It's pulling whatever is stored by vbulletin as article preview picture. Please check the last FAQ question.
@blackracoon
everything looks fine coding wise, but firebug tells me that there is a jquery error when i open your site
$("#slider") is null
Line 355
I do not know where that is comeing from. Can you try to include a different jquery file (not the vbulletin version) and see if that does fix it?
blackracoon
11-15-2011, 03:59 PM
Hi Moof,
It seems to still be bugged. I have included jquery in the slider widget now but I believe the exact same thing is happening. :(
Any other clues?
Regards
mmoore5553
11-16-2011, 06:05 AM
Okay here is what my debug says
Also the no image pulls up fine.
slider_img_filepath: http://www.wpcreations.net/vbbarefoot/slider/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: http://www.wpcreations.net/vbbarefoot/slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/mmoore/public_html/vbbarefoot
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_434.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/wildlifejohn1a.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_434.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_432.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/hennaback1.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_432.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_427.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/moreoddlooksartwork_sm.png
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_427.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_426.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/dirt50m1.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_426.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_424.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/stop-stretching.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_424.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_423.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/germany_dresden1.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_423.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_422.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/zen_circle.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_422.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_421.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/oxygenconsumption2.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_421.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_420.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/indianrunners_0.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_420.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.wpcreations.net/vbbarefoot/slider/slide_411.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://barefootrunners.org/sites/default/files/d_2b.jpg
directory: /home/mmoore/public_html/vbbarefoot/http://www.wpcreations.net/vbbarefoot/slider/slide_411.jpg#articles - featured and databasepull int(10) int(20)
blackracoon
11-16-2011, 06:19 AM
@Nmoore to resolve your issue please change in your php widget for your slider to $slider_img_filepath = 'slider/';
That should resolve your issue.
Regards, Racoon.
mmoore5553
11-16-2011, 06:37 AM
wow amazing i did not even think of that. It is working great now. Thank you so much.
blackracoon
11-16-2011, 01:31 PM
Hi,
So after hours of scanning through I worked out the issue to having a white screen, all your directories are corrrect and you retrieve this error only in firebug -
$("#slider").nivoSlider not found.
FIX:
Go to your widget you made, scroll to very end almost and edit this line:
$("#slider").nivoSlider
to
JQuery("#slider").nivoSlider
This is actually the correct way it should be called. a $ is the common way, it may not pick up the last imported library is JQuery especially if it isn't.
Regards, and Good luck!
In opera after installing this add-on my background of the entire website is white even if in doc_background is black.
In explorer, chrome and firefox is ok.
What could be the cause?
mmoore5553
11-17-2011, 11:00 PM
I found a weird issue. Everything is working fine but after some time the captions do not show up. There is no text. Anyone else run into this at all ?
Any chance to get some solution for my problem with the white background of the entire web page on opera browser?
mmoore5553
11-20-2011, 01:36 AM
I love this mod but found one error. If you let it just run for awhile it will crash. The text goes away. I think this is an issue with javascript. Is there a way to use built in vb javascript or workaround ?
Also is there a way to just have it on cms homepage ?
ablaye
11-21-2011, 02:14 AM
Why does it so long to load the first image??
If you go to my site at http://www.ndakaru.com/ , you can see when you load the page that the box when the slideshow is displayed stays white for a while (a few seconds) before the display starts.
Is there any way to speed this up?
Thanks
Mooff
11-21-2011, 02:40 AM
@DoDe
Doesn't happen on our page with opera so without a link to your page it's though to guess what might be happening.
@mmoore5553
that text disapearing bug is a nivo slider bug, not a bug comeing from my vbulletin bridge to the slider.
The FAQ should provide enough hints to switch out the jquery file.
Having widgets just showing up on the homepage and not above articles is independent of the slider. But was already answered somewhere in this thread and multiple times on vb.org. Please do a quick search.
@ablaye
I do not experience this behaviour while loading your site.
jack-d
11-21-2011, 04:03 AM
I set this up as is and it worked fine, vB 4.1.8 but I chose to pull from a specific section modifying the code as in this post,
https://vborg.vbsupport.ru/showpost.php?p=2233429&postcount=144After that change I only get the fallback image now. The path is correct and the section ID is correct because it is pulling the title and text of the article but only the fallback picture.
Been reading through this for hours and can't find a solution.
Anyone have any ideas.
EDIT: Fixed, problem with png files I have found out. No transparent bg images because of the effects.
Hi, the slider widget works fine for me :up: Great work ;)
One more problem i cannot solve:
I'm using this mod: VBCMS Threads promoted to articles link to forum thread no more article pages (https://vborg.vbsupport.ru/showthread.php?t=247758) to link by clicking "Read more" to the original forum thread - not to the article!
The code in "vbcms_content_article_preview" changes to this:
<vb:if condition="$preview_chopped">
<span class="cms_article_readmore"><a href="{vb:raw vboptions.bburl}/showpost.php?{vb:raw session.sessionurl}p={vb:raw postid}">{vb:rawphrase read_more_phrase} <img src="{vb:stylevar imgdir_cms}/read_more-{vb:stylevar right}.png" alt="{vb:rawphrase read_more_phrase}" /></a>
</span>
</vb:if>
Original code:
<vb:if condition="$preview_chopped">
<span class="cms_article_readmore"><a href="{vb:raw page_url}">{vb:rawphrase read_more_phrase} <img src="{vb:stylevar imgdir_cms}/read_more-{vb:stylevar right}.png" alt="{vb:rawphrase read_more_phrase}" /></a>
</span>
</vb:if>
I want to click on the slider image or preview text and get forwarded to the forum thread - not to the article. I think i need to change the following php codeof the slider widget code to get the effect from above: :confused:
<span>'. $article['previewtext'] .'</span> <a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">More</a>';
$article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
$article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">
I would be thankful for your suggestions :)
you can use my modified 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 = 'slider/';
//picture width and height !same as in the CSS FILE!
$maxwidth = 600;
$maxheight = 300;
//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 = 200;
//stretch picture or crop them? false = strechting (default) true = cropping (beta)
$crop = false;
//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 "Strech or Crop? $crop <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,
article.postid,
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) .'
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)
{
if($debug_modus == true OR !file_exists($slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg'))
{
//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.
echo '<span style="color:red">Error occurred:</span> imagecreation failed. ' . $article['previewimage']. '<br />';
$article['previewimage'] = $fallback_img;
}
else
{
$img_width = $imageinfo[0];
$img_height = $imageinfo[1];
if($crop == false)
{
imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
imagedestroy($image);
}
else
{
//cropping
$ratiox = $maxheight / $img_height ;
$ratioy = $maxwidth / $img_width ;
$new_height = $img_height;
$new_width = $img_width;
if ($maxheight > $img_height OR $maxwidth > $img_width)
{
if($ratiox > $ratioy)
{
$new_height = round($img_height * $ratiox);
$new_width = round($img_width * $ratiox);
}
else
{
$new_height = round($img_height * $ratioy);
$new_width = round($img_width * $ratioy);
}
}
$cropx = $new_height - $maxheight;
$cropy = $new_width - $maxwidth;
imagecopyresampled($sprite, $image, 0, 0, 0, 0, $new_width, $new_height, $img_width, $img_height);
imagedestroy($image);
}
$img_filepath = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.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.
echo '<span style="color:red">Error occurred:</span> picture is not readable.' . $article['previewimage']. '<br /> ';
$article['previewimage'] = $fallback_img;
}
}
else
{
//resiziing did not work - we are using the fallback image.
echo '<span style="color:red">Warning:</span> article has no previewimage or sprite is no ressource. ' . $article['previewimage']. '<br />';
$article['previewimage'] = $fallback_img;
}
}
else
{
//we already have the image, no need to resize or crop anything
$article['previewimage'] = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg';
}
/*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="http://yoursite.com/forum/showpost.php?p=' . $article['postid']. '">Xem chi tiết</a>';
$article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
$article_neu['picture'] = '<a href="http://yoursite.com/forum/showpost.php?p=' . $article['postid']. '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $article['nodeid'] . '" /></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-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() {
$("#slider").nivoSlider();
});
</script>
</div>
';
$output = $output_bits;
if($debug_modus === false)
{
ob_end_clean();
}
Change red text color with your forum url;). The result is when you click to preview text or picture it will go to the post that you promoted:cool:
ablaye
11-21-2011, 02:18 PM
@ablaye
I do not experience this behaviour while loading your site.
Yes, it does take quite a while to load the slides. Go to http://www.ndakaru.com and watch the box that says "A LA UNE". It takes a few seconds for the slides to load.
Any idea on how to make the slides load at the same time as the rest of the site?
@DoDe
Doesn't happen on our page with opera so without a link to your page it's though to guess what might be happening.
Please take a look on the www.dfgrom.com
I use the standard style to have a better understanding. The vbulletin version is v4.1.8 and the default color of the background should be: #e9e9e9 but it's white. If you look into the source code of the webpage you will notice that there is no white color at all. This is a strange bug only noticed in opera browser.
SOLVED:
I got it work. I downloaded the newest "jquery-1.7.1.min.js" released yesterday (21st november) and it resolved my problem.
If anyone interested then here is the [ link (http://code.jquery.com/jquery-1.7.1.min.js) ].
Loversama
11-23-2011, 08:24 AM
This isn't 100% related just to this mod but I thought I'd ask as I have been unsuccessful.
I bought VB CMS just to have this mod.
The United-Forum has the widget as the background, I too am trying to load the widget somewhere else, not using the CMS system, I am trrying to do this:
{vb:raw header}
{vb:raw output} <--- The Slider
{vb:raw navbar}
{vb:raw toolbar}
The widget does not load, I know its abit of a noobie question, but I am lost lol
Thanks in Advanced ^____^
This isn't 100% related just to this mod but I thought I'd ask as I have been unsuccessful.
I bought VB CMS just to have this mod.
The United-Forum has the widget as the background, I too am trying to load the widget somewhere else, not using the CMS system, I am trrying to do this:
{vb:raw header}
{vb:raw output} <--- The Slider
{vb:raw navbar}
{vb:raw toolbar}
The widget does not load, I know its abit of a noobie question, but I am lost lol
Thanks in Advanced ^____^
I would first try this tip: https://vborg.vbsupport.ru/showthread.php?p=2222907#post2222907
Loversama
11-23-2011, 11:16 AM
I would first try this tip: https://vborg.vbsupport.ru/showthread.php?p=2222907#post2222907
I have had a look, but I don't really understand it, will that allow me to design a secondary header with the widget built into it, rather then using 'Layout Manager' to place my widget.
It would be nice if {raw: output} in any template would show the slider, how/what do I hook to allow my vbcms_page to load the widget inside ;o
$templater = \vB_Template::create('vbcms_page');
$templater->register('output', $output);
$template_hook['process_templates_complete'] .= $templater->render();
Template Name: vbcms_page
Thats my widget settings, and ofc {raw: output} inside of vbcms_page.
karlm
11-23-2011, 10:38 PM
Working good on my 4.1.8 :)
Webbstre
11-24-2011, 05:31 AM
I'm just going to echo loversama and repeat that I'm trying my best to get the header to who up inside my header, site-wide. I've followed everything mentioned here but I'm just stumped. I've got the widget loaded into a plugin, it loads on process_templates_complete, and this is the bottom three lines of my plugin:
$templater = vB_Template::create('nivo_slider');
$templater->register('output', $output);
$template_hook['process_templates_complete'] .= $templater->render();
I've also made that template and on any page other than the CMS home I still get this:
Fatal error: Class 'vb_Types' not found in /home/user/mysite.com/includes/class_bootstrap.php(549) : eval()'d code on line 78
If I load the CMS home it will load without any error but there is no slider anywhere, as I've removed it from my CMS layout.
PS. If we can get this slider loading site-wide and get the instructions up on this thread in an easy-to-understand manner I'll gladly donate 25 bucks to your site ;)
Loversama
11-24-2011, 08:28 AM
I've also made that template and on any page other than the CMS home I still get this:
Fatal error: Class 'vb_Types' not found in /home/user/mysite.com/includes/class_bootstrap.php(549) : eval()'d code on line 78
I am getting something similar, but my forum is failing to load due to Database Error.
My logs show
[24-Nov-2011 02:22:37] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home1/******i/public_html/includes/class_bootstrap.php(555) : eval()'d code on line 548
I am having to manually go through my DB to try and fix this =[
I found that
($hook = vBulletinHook::fetch_hook('process_templates_compl ete')) ? eval($hook) : false;
Is on line 555 of bootstrap, so that kinda shows why its phailing, now to look into that *Sigh*
I really want the slider working nicely, its the whole reason I bought the publishing suite :P
Webbstre
11-24-2011, 08:54 AM
Remove the \ from the first of the three lines I listed. That moves you on to the other error.
Loversama
11-24-2011, 09:24 AM
Remove the \ from the first of the three lines I listed. That moves you on to the other error.
Ahh, I did that, didnt get my old Error anymore but I still get a Database problem, nothing showed up in the logs though..
So lost untill Mooff shares his infinite wisdom on how they managed to do it :P
Webbstre
11-24-2011, 09:56 AM
Also lost :P I'm serious about a donation though.
Mooff
11-25-2011, 04:28 PM
Just a quick note to that vb_Types error, that is this line:
$article_type = vb_Types::instance()->getContentTypeID("vBCms_Article");
For our board the article content type id is 18. That might be different for your board, check your database and then change it to the number like this
$article_type = 18;
But that aside if you do want to use it in the cms anyway, why don't you use the php-eval content type (to have that in your content selector you need to activate html for your usergroup, yeah that is confusing)? Or create a bunch of subsections where you want to have it?
That template way is for sites not in the cms, like forumhome or external php files (files like this: http://www.united-forum.de/external/unitedforum/geo/membermap.php - in the framework using the template system, but link leads to a php file, no slider on that example though).
edit: btw. you might want to change the variable name $output to something else in a global plugin. That might colide with $output variables vbulletin is using. Rename it everywhere to $slider_output or something.
Strange thing now happens with my slider.
In debug mode I receive this message:
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 950 height: 390
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /var/www/mnt/nfs03/nfs2/html/pro/dfgrom.com/root
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=64&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=59&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=58&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=56&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=41&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=40&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=36&cid=24
#articles - featured and databasepull int(7) int(7)
The permissions in the cms permissions section are:
www.dode.dfgrom.com/permissions.JPG
The slider folder is 0777.
GD library is installed.
Any ideas?
Mooff
11-28-2011, 01:35 AM
manually opening one of your attachment links gives me an auth box - the slider will see the same and therefore cannot read that attachment.
thanks,
that was the problem :up:
Loversama
11-28-2011, 07:35 AM
Strange thing now happens with my slider.
In debug mode I receive this message:
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 950 height: 390
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /var/www/mnt/nfs03/nfs2/html/pro/dfgrom.com/root
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=64&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=59&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=58&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=56&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=41&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=40&cid=24
Error occurred: picture is not readable.http://www.dfgrom.com/attachment.php?attachmentid=36&cid=24
#articles - featured and databasepull int(7) int(7)
The permissions in the cms permissions section are:
www.dode.dfgrom.com/permissions.JPG
The slider folder is 0777.
GD library is installed.
Any ideas?
thanks,
that was the problem :up:
I have got to that bit now also!
Did you get it working? ;o
Well in my case I had that problem due to the .htaccess on the website. I'm at the stage of making my website and I don't want anyone else to see it online till it's finished and that's why I've put the .htaccess file (you know, no one can access the website or any file on the server without entering the login and password which are configured in the .htaccess file). To check the proper functionality I removed during the test that file and everything started to work properly.
If that's not your case then I suggest looking into the cms permissions of "Can Download Attachments" for unregistered users.
Try clearing the system cache in the maintenance tab after adding an article.
Check the folder where you store the slider files and see if it's attributes are 0777.
karlm
11-28-2011, 06:24 PM
I wish to make use of this in different areas (categories) of the site, I've followed the instructions on how to do that from the FAQ.
I made a separate folder and gave it 777 permissions - it reflected the standard logo. However, once I add the code from the FAQ for categories....
node.publishdate < '. vb::$db->sql_prepare($time) .' AND
category.categoryid IN ( 9 )
GROUP BY node.nodeidIt stops working entirely and shows only a blank slate.
Coolbluelogo
11-28-2011, 10:53 PM
I have got to that bit now also!
Did you get it working? ;o
I'm also having this issue.
Error occurred: picture is not readable.<link>
However, when I manually open the link, the image is displayed...anyone know what the problem is?
Maybe a bug in the latest release?
intruder
11-29-2011, 05:35 AM
Is there any way to add the text below the image in the slideshow?
http://alturl.com/p6fws
Thanks
Loversama
11-29-2011, 07:45 AM
If that's not your case then I suggest looking into the cms permissions of "Can Download Attachments" for unregistered users.
Try clearing the system cache in the maintenance tab after adding an article.
Check the folder where you store the slider files and see if it's attributes are 0777.
Well I can see its not the .htaccess file, and I have also tried what you have suggested but I am still getting the same issue.
The attachments look like this:
????JFIF``??C $.' ",#(7),01444'9=82<.342??C 2!!222222222222222222222222222222222222222222222 22222????"?? ?ĵ}!1AQa"q2???#B??R??$3br? %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz??????? ?????????????????????????????????????????????????? ?????????????????? ?ĵw!1AQaq"2?B???? #3R?br? $4?%?&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz???????? ?????????????????????????????????????????????????? ?????????????????椄???{?$@?+f?Q????
Well theres lots more, but I know thats the Images code stuffs, so I might be like that...
But I have checked permissions ect, refreshed the cache ect..
DoDe did you actually get it working then? ;o
Yes I did, it's working fine...
Is your board on local or on the webserver?
Loversama
11-29-2011, 11:19 AM
Yes I did, it's working fine...
Is your board on local or on the webserver?
webserver..
www.SinfulShadows.com
however when the plugin is loaded it only loads 20% of the time, as the database errors while its half broken so the plugin is disabled.
Not sure what to do about it, but I really really want to get this working, I want to put the slider in just above the navbar (thats the reason I don't want it as a widget or anything else)
Mooff
11-30-2011, 11:02 PM
I wish to make use of this in different areas (categories) of the site, I've followed the instructions on how to do that from the FAQ.
I made a separate folder and gave it 777 permissions - it reflected the standard logo. However, once I add the code from the FAQ for categories....
node.publishdate < '. vb::$db->sql_prepare($time) .' AND
category.categoryid IN ( 9 )
GROUP BY node.nodeidIt stops working entirely and shows only a blank slate.
please try
node.publishdate < '. vb::$db->sql_prepare($time) .' AND
category.categoryid = 9
GROUP BY node.nodeid
@Coolbluelogo
I need more debug, please follow the faq
@intruder
untested:
find
$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">
replace with:
$newheight = $maxheight + 42;
$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:' . $newheight . 'px;">
<div id="wrapper">
and in the css file which you uploaded to your server find this part:
.nivo-caption {
background: none repeat scroll 0 0 #0D2132;
bottom: 0px;
color: #FFFFFF;
left: 0;
opacity: 0.4;
position: absolute;
width: 100%;
z-index: 8;
}
and change the bottom value to -42px
@Loversama
I need more information on the database error so i can help.
Loversama
12-01-2011, 08:09 AM
@Loversama
I need more information on the database error so i can help.
I will post everything I have done up to now and hopefully you can point out where I am going wrong ^___^
Plugins & Products -> Plugin Manager -> Add New Plugin
Product = vBulletin
Hook Location = process_templates_complete
Title = nivo_slider
Plugin PHP Code =
// DEBUG MODUS !
$debug_modus = true;
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 = '/slider/';
//picture width and height !same as in the CSS FILE!
$maxwidth = 650;
$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 = 10;
//lengh in characters of the article descriptions
$description_length = 95;
//stretch picture or crop them? false = strechting (default) true = cropping (beta)
$crop = false;
//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 "Strech or Crop? $crop <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) .'
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)
{
if($debug_modus == true OR !file_exists($slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg'))
{
//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.
echo '<span style="color:red">Error occurred:</span> imagecreation failed. ' . $article['previewimage']. '<br />';
$article['previewimage'] = $fallback_img;
}
else
{
$img_width = $imageinfo[0];
$img_height = $imageinfo[1];
if($crop == false)
{
imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
imagedestroy($image);
}
else
{
//cropping
$ratiox = $maxheight / $img_height ;
$ratioy = $maxwidth / $img_width ;
$new_height = $img_height;
$new_width = $img_width;
if ($maxheight > $img_height OR $maxwidth > $img_width)
{
if($ratiox > $ratioy)
{
$new_height = round($img_height * $ratiox);
$new_width = round($img_width * $ratiox);
}
else
{
$new_height = round($img_height * $ratioy);
$new_width = round($img_width * $ratioy);
}
}
$cropx = $new_height - $maxheight;
$cropy = $new_width - $maxwidth;
imagecopyresampled($sprite, $image, 0, 0, 0, 0, $new_width, $new_height, $img_width, $img_height);
imagedestroy($image);
}
$img_filepath = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.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.
echo '<span style="color:red">Error occurred:</span> picture is not readable.' . $article['previewimage']. '<br /> ';
$article['previewimage'] = $fallback_img;
}
}
else
{
//resiziing did not work - we are using the fallback image.
echo '<span style="color:red">Warning:</span> article has no previewimage or sprite is no ressource. ' . $article['previewimage']. '<br />';
$article['previewimage'] = $fallback_img;
}
}
else
{
//we already have the image, no need to resize or crop anything
$article['previewimage'] = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg';
}
/*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' . $article['nodeid'] ;
$article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $article['nodeid'] . '" /></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-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() {
$("#slider").nivoSlider();
});
</script>
</div>
';
$output = $output_bits;
if($debug_modus === false)
{
ob_end_clean();
}
$templater = \vB_Template::create('vbcms_page');
$templater->register('nivo_slider', $output);
$template_hook['process_templates_complete'] .= $templater->render();
Styles & Templates -> vbcms_page
{vb:raw header}
{vb:raw nivo_slider}
{vb:raw navbar}
{vb:raw toolbar}
Then the website will only some times load, half the time it will get:
Database error
The database has encountered a problem.
And the other time I get:
DEBUG MODE is ON!
slider_img_filepath: /slider/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: /slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home1/fadertwi/public_html
Error occurred: picture is not readable.http://www.sinfulshadows.com/attachment.php?attachmentid=255&cid=24
Error occurred: picture is not readable.http://www.sinfulshadows.com/attachment.php?attachmentid=256&cid=24
Error occurred: picture is not readable.http://www.sinfulshadows.com/attachment.php?attachmentid=254&cid=24
Error occurred: picture is not readable.http://www.sinfulshadows.com/attachment.php?attachmentid=252&cid=24
Error occurred: picture is not readable.http://www.sinfulshadows.com/attachment.php?attachmentid=250&cid=24
Error occurred: picture is not readable.http://www.sinfulshadows.com/attachment.php?attachmentid=251&cid=24
Error occurred: picture is not readable.http://www.sinfulshadows.com/attachment.php?attachmentid=248&cid=24
#articles - featured and databasepull int(7) int(7)
I also get a error in the PHP which does not display onscreen but in the logs which is:
[01-Dec-2011 02:04:44] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home1/fadertwi/public_html/includes/class_bootstrap.php(555) : eval()'d code on line 505
I have also tried the method of changing the article type as you suggested.
$article_type = vb_Types::instance()->getContentTypeID("vBCms_Article");
to
$article_type = 24;
which is the article type in the DB however that causes the process_templates_complete to not allow any other hooks, or it crashes or something..
So yea pretty stuck, but it'd be amazing if I could fix this, I am re-modling my website at the moment and I really need the slider in my header! :D
my website is www.SinfulShadows.com however I will have to disable the plugin as my members will not be able to access my site freely while its crashing.
Booyakan
12-05-2011, 03:25 AM
Is it possible to have this on forumhome if we do not have cms? And possible instructions if so?
I tried the static code with forumhome instructions from the FAQ but could not get it working.
Mooff
12-07-2011, 01:12 PM
@Loversama
I thought that '\' Error was solved some pages ago?
the "Error occurred: picture is not readable." comes from fopen or allow_url open not beeing ON in the server configuration (i guess)
the DB-Error. I don't know, without an error message what that database error is i'm lost here.
@Booyakan
Without CMS you can only use the static version and that should be possible on forumhome either via plugin and templatehook. Or editing the template itself, or using the notice system - depending on where you want the static version to appear.
Booyakan
12-08-2011, 03:25 AM
@Loversama
I thought that '\' Error was solved some pages ago?
the "Error occurred: picture is not readable." comes from fopen or allow_url open not beeing ON in the server configuration (i guess)
the DB-Error. I don't know, without an error message what that database error is i'm lost here.
@Booyakan
Without CMS you can only use the static version and that should be possible on forumhome either via plugin and templatehook. Or editing the template itself, or using the notice system - depending on where you want the static version to appear.
Thank you, got it!
Hi @,
After I moved to another host I receive the following warrning and the images are not pulled:
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 950 height: 390
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/dode/www
Warning: array_multisort() [function.array-multisort]: Argument #1 is expected to be an array or a sort flag in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 110
I would appriciate any help.
Thanks!
Problem solved: problem with the templates during migration.
The slider seems to be working for me which is great but it continues to target articles that do not have images. I have the widget code set to false; for showing sections without image, yet it continues to do so. Any one have an idea?
Valker
12-13-2011, 09:13 PM
Hi !
2 questsions:
Does it work with nivo slider 2.7 and how do i update?
and
how do i limit the transistion effekt to fade ?
Edit: and i?ve got a third request:
does it lag ?
http://www.trinitas-gilde.com/content.php
I?ts lagging a bit in FF, in IE it lags very strong but in Chrome or Opera its totally fluid.
(at first it lagged only at a friends pc, but i switchted mine a few day for a few day with for an upodate, now it lags on this (little) pv even.)
Actually he even made a video:
http://www.youtube.com/watch?feature=player_embedded&v=ird7NFxDHig
Dr.osamA
12-14-2011, 08:45 AM
thank you bro
installed
Mooff
12-14-2011, 09:07 PM
@kenp
please post the debug (last faq question)
@Valker
nivo slider 2.7 - yes, it should work with nivo slider 2.7 - i have modified our nivo slider jquery file so i can't test it right away, but in theory you just have to switch the jquery.nivo.slider.pack.js file which is included in the first post and update that file on your server with their new version.
yes it does lag quite a bit, first you have two jquery files included on your site (check the faq what to change) and if that doesn't help change the 1.6.4 jquery file you are using with a different/newer version.
Your site looks awesome btw. :)
Valker
12-15-2011, 09:08 PM
Thanks :D!
I gonna check this tomorrow and will report :D
Valker
12-16-2011, 02:52 AM
Omg thanks a lot, it worked.
but, i didn?t figured out how to set the transistion effect. On nivo slider?s site they say:
As of v2.7 you can now override a slides transition using the data-transition attribute. For example:
<img src="images/slide1.jpg" alt="" data-transition="slideInLeft" />
The above code will force this slide to use the slideInLeft transition every time it appears. It overrides all other effect settings.
but i didn?t find something like this in the pack code or the widget file. ;/
inigo
12-17-2011, 06:23 PM
After it was working correctly I?ve begun to receive this error:
XML tag name mismatch (expected meta)
[Stop in this errorr] </head>
jquery....min.js (l?ne 4)
XML tag name mismatch (expected meta)
[Stop in this error] </head>
jquery...pack.js (l?ne 4)
XML tag name mismatch (expected meta)
[Stop in this error] </head>
jquery....min.js (l?ne 4)
$("#slider").nivoSlider is not a function
[Detener en este error] $("#slider").nivoSlider();
In firebug, and the images and text are showing but not the slider, only one below the other.
Can you help me with this? Any idea? I have read this topic, but i haven't find this issue explained.
Thanks in advance for any help!
Valker
12-19-2011, 04:42 PM
hm may i help you ? do you give me a link perhaps ?
I´m not sure why this error occure...did you some changes is your vb ? updates or such ?
For me it looks like the js files arn´t connected...but i´m not sure.
The Rocketeer
12-19-2011, 11:00 PM
hey Mooff, The Slider is causing refresh problems even after I clear the cache in the admin CP and also after clearing it on my browser. The Slider doesn't show the newly Featured Article.
is there a fix?
I would like to have the slider set o a sub-domain to hopefully reduce the amount of requests on the server. I do not see where in the uploaded files I can tell it to do so. Can you point me in the right direction please.
rose123
12-22-2011, 02:28 AM
This works great for me but I was expecting when user clicks on slide, it will direct the user to original page where article is published.
What happens is
I have slide show on home page and primary content on home page
When user clicks on slide, it displays the clicked article under primary content and does not direct the user to original page where article is published.
Thanks in advance for your time.
Valker
12-22-2011, 08:54 AM
Hi, its me again ;S
So, we moved our site on another server caus of namechange.
-> http://www.minions-guild.com/content.php
I actually updated the version to 4.1.9 - but now the slider doen?t work. I reinstalled it as it was originally (not newest jquery and newest slider version, which worked btw) but, its white, so i guess it has something to do with java.
vb updated some js files as i saw....does this - 4.1.9 - uccure the issue ?
doctorsexy
12-22-2011, 09:00 AM
I had the opposite didnt work well with 4.1.8 works well with 4.1.9
Valker
12-22-2011, 09:13 AM
we love vb :)
The Rocketeer
12-22-2011, 09:14 AM
I am also having problems, It has stopped displaying any new featured articles :(
I placed some new articles in the featured articles category like I always do but the slider only displays the old ones. It was working fine few weeks ago but now no new article is shown in the slider. Do I have to manually deselect older featured articles to make way for new ones?
Hopefully Mooff will be back here soon, after Christmas and can help us all with the problems :)
Valker
12-24-2011, 06:58 AM
so i rerolled my forum once again to 4.1.7 - and i never ever will update it again :D
Neptun
12-24-2011, 02:52 PM
i have VBSEO running - is there a fix to get it working with vbseo - i get online the whole urls not rewritten with seo ?!
Thank you for help - the rest works great - perfect hack
basilrath
01-01-2012, 05:42 PM
Love this mod
works fab with 4.1.9 also
Just worth mentioning the codeline
$article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $article['nodeid'] . '" /></a>';
youl probably have to drop the r= out for direct links to be achieved correctly
Plus if your board has a url like mine such as
http://www.tabletennistalk.co.uk/forum/forum.php
your slider folder still should be 'slider/'
which is confusing some i think and will rectify many errors
Dear Mooff,
I have the micro-cart (https://vborg.vbsupport.ru/showthread.php?t=256723&highlight=micro-cart) system installed on my vbulletin with the slider on the main CMS.
Is it possible to take the products from micro-cart to show on the nivo-slider?
I mean if I put a product on sell throw micro-cart and I also put there a picture for it then I would like it to show on nivo-slider along with the proper link to that product.
Thanks in advance!
singh9211
01-09-2012, 06:00 AM
really liked the mod, thanks for the contribution......
Mooff
01-13-2012, 08:08 PM
Sorry guys for the long wait, i have been really busy lately.
Dear Mooff,
I have the micro-cart (https://vborg.vbsupport.ru/showthread.php?t=256723&highlight=micro-cart) system installed on my vbulletin with the slider on the main CMS.
Is it possible to take the products from micro-cart to show on the nivo-slider?
I mean if I put a product on sell throw micro-cart and I also put there a picture for it then I would like it to show on nivo-slider along with the proper link to that product.
Thanks in advance!
That would need a different database query. But yes, it is possible.
This works great for me but I was expecting when user clicks on slide, it will direct the user to original page where article is published.
What happens is
I have slide show on home page and primary content on home page
When user clicks on slide, it displays the clicked article under primary content and does not direct the user to original page where article is published.
Thanks in advance for your time.
I'm sorry, can you please rephrase your question or provide links what happens and what behaviour you would prefer?
I would like to have the slider set o a sub-domain to hopefully reduce the amount of requests on the server. I do not see where in the uploaded files I can tell it to do so. Can you point me in the right direction please.
I'm sorry, can you please rephrase your question?
hey Mooff, The Slider is causing refresh problems even after I clear the cache in the admin CP and also after clearing it on my browser. The Slider doesn't show the newly Featured Article.
is there a fix?
Are you running the latest version? Can you link me to your site?
nice mod, and thanks for the great contribution
I have a small problem with the mood , it works perfect but it doesn't load the images from articles it gets the standard one from the slider folder. I think the problem is because I have the CMS in www.site.com and the forum in www.forum.site.com. When I try to see an atachament from an article the link looks like www.forum.site.com/atachamnets/image.jpg. And I also use vbseo but I think that is not a problem.
jb-net
01-16-2012, 06:40 AM
Excellent vb4 mod!
I'm not the best php coder so I would like to ask you:
Is there a possibility to add a static slide independently from the last articles?
Example:
Slide 1 - 3 ... the last articles from the cms
Slide 4 ... a static one, per example an advertisement for the vbulletin iphone app, linked to an external website (like itunes store)
Is there a easy way to realize something like this?
The Rocketeer
02-06-2012, 03:38 AM
@Mooff
Hey Mooff, is there anyway to make this thing work without fopen please? then if you could please post detailed instructions?
One of our sites was recently compromised by a exploit (JA Agent), and we have spent weeks repairing things and switching servers. So a bit hesitant to allow_url_fopen On. Even the new server host said I could try adding this code php_value allow_url_fopen On to the .htaccess, I am still a bit hesitant in doing so.
The Rocketeer
02-06-2012, 08:47 PM
Also Mooff, Its giving me some issues, all I get is the fallback image, and also it doesn't update newly chosen articles anymore. I am not sure what the problem is, I have fopen from the .htaccess file. I here is the debug
DEBUG MODE is ON!
slider_img_filepath: frontpage_nivo_slider/
width: 650 height: 250
show_articles_without_image:
fallback_img: frontpage_nivo_slider/uf_fallback_slider.png
#img: 10
description_length: 95
Error occurred: picture is not readable.frontpage_nivo_slider/uf_fallback_slider.png
Error occurred: picture is not readable.frontpage_nivo_slider/uf_fallback_slider.png
Error occurred: picture is not readable.frontpage_nivo_slider/uf_fallback_slider.png
Error occurred: picture is not readable.frontpage_nivo_slider/uf_fallback_slider.png
Error occurred: picture is not readable.frontpage_nivo_slider/uf_fallback_slider.png
Error occurred: picture is not readable.frontpage_nivo_slider/uf_fallback_slider.png
Error occurred: picture is not readable.frontpage_nivo_slider/uf_fallback_slider.png
Error occurred: picture is not readable.frontpage_nivo_slider/uf_fallback_slider.png
Error occurred: picture is not readable.frontpage_nivo_slider/uf_fallback_slider.png
here's a link to my the forum
tomorrowsgaming.com
iyama
02-08-2012, 02:21 PM
Installed buth only see the uf_fallback_slider.png with the articel txt.
The Rocketeer
02-10-2012, 09:18 AM
Also same problem here. We need Mooff. :(
basilrath
02-10-2012, 12:55 PM
Paths are incorrect
i had same issue
iyama
02-13-2012, 08:09 AM
path is correct here, and stil noo images.
basilrath
02-13-2012, 04:43 PM
Did you read this and have you tried it?
Love this mod
works fab with 4.1.9 also
Just worth mentioning the codeline
PHP Code:
$article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $article['nodeid'] . '" /></a>';
youl probably have to drop the r= out for direct links to be achieved correctly
Plus if your board has a url like mine such as
http://www.tabletennistalk.co.uk/forum/forum.php
your slider folder still should be 'slider/'
which is confusing some i think and will rectify many errors
UK CHI3F
02-15-2012, 02:30 PM
Hello, I currently have a poor image sliderat the top of my page
But love the way this is supposed to look,
unfortunately I am no expert but believe I followed the instructions correctly.
At the bottom of my site you will see the slider
http://www.xboxplayers.co.uk/site/content.php
Below is the first part of the code and the revised path was copied directly from my cpanel file manager and pasted in.
Both widget and css file have the same image sizes.
I changed the image path if no image found to true but no fallback image has appeared.
Really appreciate any help. Thanks in advance
// 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 = '/public_html/site/Slider';
//picture width and height !same as in the CSS FILE!
$maxwidth = 650;
$maxheight = 250;
//do you want images without previewimage to be shown? slider is using the fallback then
$show_articles_without_image = true;
//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 = 10;
The Rocketeer
02-15-2012, 09:12 PM
nope still not working, only see fallback and old articles text. ever since the 418 upgrade this has never been working the same. now in 410 its fully broken.
where is mooff?
The Rocketeer
02-19-2012, 12:59 AM
So what is this mod Unsupported now? :(
Mooff
02-20-2012, 01:06 AM
@UK CHI3F
I need the debug the slider puts out in debug mode. See FAQ.
@The Rocketeer
You are using an old version, the widget code has changed and produces more debug. Try the new one that will produce nicer error messages so i can see what is wrong.
As for support, i currently do not have that much time, but i think the FAQ should cover almost everything. ;)
iyama
02-22-2012, 10:44 AM
I upload the pack again and set the correct path.
I see the text buth no images.
Only the uf_fallback_slider.png is showing.
Mooff
02-22-2012, 06:32 PM
And i still need the debug. See FAQ in post 2.
Zervesa
02-25-2012, 09:52 AM
Same Problem here:
DEBUG MODE is ON!
slider_img_filepath: http://www.xxx.de/forum/slider/
width: 600 height: 350
Strech or Crop? 1
show_articles_without_image: bool(false)
fallback_img: http://www.xxx.de/forum/slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /var/www/vhosts/xxx.de/httpdocs/forum
Warnung: imagejpeg() [function.imagejpeg]: Unable to open '[path]/http://www.xxx.de/forum/slider/slide_107.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code (Zeile 200)
Error occurred: imagejpeg failed. http://www.xxx.de/forum/attachment.php?attachmentid=312&cid=24
directory: /var/www/vhosts/xxx.de/httpdocs/forum/http://www.xxx.de/forum/slider/slide_107.jpg#articles - featured and databasepull int(1) int(1)
Warnung: Cannot modify header information - headers already sent by (output started at [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code:39) in [path]/includes/functions.php (Zeile 5302)
Mooff
02-25-2012, 01:21 PM
silder_img_filepath should not be a http location. We need that to write the images to.
In your case
$slider_img_filepath = 'slider/';
should be the right choice.
Zervesa
02-25-2012, 01:43 PM
Thank you!
virtualcash
03-01-2012, 06:56 AM
Thanks for the great plugin, Mooff. After upgrading vb to 4.1.11 I'm getting the following debug output for http://e-mpire.com/ :
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 780 height: 400
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/e-mpire/public_html
Warning: getimagesize(attachment.php?attachmentid=14092&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14092&cid=18
Warning: getimagesize(attachment.php?attachmentid=14083&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14083&cid=18
Warning: getimagesize(attachment.php?attachmentid=14096&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14096&cid=18
Warning: getimagesize(attachment.php?attachmentid=14091&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14091&cid=18
Warning: getimagesize(attachment.php?attachmentid=14095&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14095&cid=18
Warning: getimagesize(attachment.php?attachmentid=14084&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14084&cid=18
Warning: getimagesize(attachment.php?attachmentid=14090&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14090&cid=18
Warning: getimagesize(attachment.php?attachmentid=14088&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14088&cid=18
Warning: getimagesize(attachment.php?attachmentid=14081&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14081&cid=18
Warning: getimagesize(attachment.php?attachmentid=14082&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14082&cid=18
#articles - featured and databasepull int(10) int(20)
Griphus
03-03-2012, 01:48 PM
Thanks for the great plugin, Mooff. After upgrading vb to 4.1.11 I'm getting the following debug output for http://e-mpire.com/ :
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 780 height: 400
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/e-mpire/public_html
Warning: getimagesize(attachment.php?attachmentid=14092&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14092&cid=18
Warning: getimagesize(attachment.php?attachmentid=14083&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14083&cid=18
Warning: getimagesize(attachment.php?attachmentid=14096&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14096&cid=18
Warning: getimagesize(attachment.php?attachmentid=14091&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14091&cid=18
Warning: getimagesize(attachment.php?attachmentid=14095&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14095&cid=18
Warning: getimagesize(attachment.php?attachmentid=14084&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14084&cid=18
Warning: getimagesize(attachment.php?attachmentid=14090&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14090&cid=18
Warning: getimagesize(attachment.php?attachmentid=14088&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14088&cid=18
Warning: getimagesize(attachment.php?attachmentid=14081&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14081&cid=18
Warning: getimagesize(attachment.php?attachmentid=14082&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.attachment.php?attachmentid=14082&cid=18
#articles - featured and databasepull int(10) int(20)
I am also getting this error at www.tribegaming.com since updating Vbulletin this morning:
DEBUG MODE is ON!
slider_img_filepath: /slideshow/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: /slideshow/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/content/08/8830708/html
Warning: getimagesize(attachment.php?attachmentid=3628&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3628&cid=18
Warning: getimagesize(attachment.php?attachmentid=3541&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3541&cid=18
Warning: getimagesize(attachment.php?attachmentid=3545&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3545&cid=18
Warning: getimagesize(attachment.php?attachmentid=3527&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3527&cid=18
Warning: getimagesize(attachment.php?attachmentid=3509&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3509&cid=18
Warning: getimagesize(attachment.php?attachmentid=3502&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3502&cid=18
Warning: getimagesize(attachment.php?attachmentid=3497&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3497&cid=18
Warning: getimagesize(attachment.php?attachmentid=3474&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3474&cid=18
Warning: getimagesize(attachment.php?attachmentid=3490&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3490&cid=18
Warning: getimagesize(attachment.php?attachmentid=3462&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=3462&cid=18
#articles - featured and databasepull int(10) int(20)
Mooff
03-03-2012, 11:59 PM
At first glance it seems like they change how the picture url for attachments are saved in the database (we are not on 4.1.11 yet, so i can't check).
untested:
change
if(is_resource($sprite) AND $article['previewimage'] )
{
$imageinfo = getimagesize($article['previewimage']);
if(is_array($imageinfo))
{
to
if(is_resource($sprite) AND $article['previewimage'] )
{
if(substr($article['previewimage'],0,10) == 'attachment')
{
$article['previewimage'] = 'http://www.your_site/' . $article['previewimage'];
};
$imageinfo = getimagesize($article['previewimage']);
if(is_array($imageinfo))
{
with 'your_site' beeing your site. ;)
Griphus
03-04-2012, 02:53 AM
At first glance it seems like they change how the picture url for attachments are saved in the database (we are not on 4.1.11 yet, so i can't check).
untested:
change
if(is_resource($sprite) AND $article['previewimage'] )
{
$imageinfo = getimagesize($article['previewimage']);
if(is_array($imageinfo))
{
to
if(is_resource($sprite) AND $article['previewimage'] )
{
if(substr($article['previewimage'],0,10) == 'attachment')
{
$article['previewimage'] = 'http://www.your_site/' . $article['previewimage'];
};
$imageinfo = getimagesize($article['previewimage']);
if(is_array($imageinfo))
{
with 'your_site' beeing your site. ;)
This worked for me. You are my hero.
sweetpotato
03-04-2012, 09:16 AM
At first glance it seems like they change how the picture url for attachments are saved in the database (we are not on 4.1.11 yet, so i can't check).
untested:
change
if(is_resource($sprite) AND $article['previewimage'] )
{
$imageinfo = getimagesize($article['previewimage']);
if(is_array($imageinfo))
{
to
if(is_resource($sprite) AND $article['previewimage'] )
{
if(substr($article['previewimage'],0,10) == 'attachment')
{
$article['previewimage'] = 'http://www.your_site/' . $article['previewimage'];
};
$imageinfo = getimagesize($article['previewimage']);
if(is_array($imageinfo))
{
with 'your_site' beeing your site. ;)
Thank for the nice code. It works for me with VB 4.1.11
sweetpotato
03-04-2012, 02:32 PM
For my vb 4.1.11 I still face this database error always:
Database error in vBulletin 4.1.11:
Invalid SQL:
REPLACE INTO cache
SET cacheid = 'widget_53.9ac7ba1932b4e2e872730e6f5459772e',
expires = 1330870172,
created = 1330869872,
locktime = 0,
data = "\n <link rel=\"stylesheet\" href=\"cms_slider/nivo-slider.css\" type=\"text/css\" media=\"screen\" />\n <link rel=\"stylesheet\" href=\"cms_slider/nivo-slider_uf_theme.css\" type=\"text/css\" media=\"screen\" />\n <div style=\"height:250px;\">\n <div id=\"wrapper\">\n <div class=\"slider-wrapper theme-uf\">\n <div class=\"ribbon\"></div>\n <div id=\"slider\" class=\"nivoSlider\"><a href=\"/content.php?r=246-
ferruzo
03-04-2012, 04:52 PM
It just works for cms?
Zervesa
03-05-2012, 04:10 PM
Gives a way, that the Slider automatically resize a picture in an artikel to show in the slide?
i mean some pictures in articels are bigger then the slider size. and the slider dont show this pictures and use so, the fallback image.
w3rk3d
03-05-2012, 05:11 PM
At first glance it seems like they change how the picture url for attachments are saved in the database (we are not on 4.1.11 yet, so i can't check).
untested:
change
if(is_resource($sprite) AND $article['previewimage'] )
{
$imageinfo = getimagesize($article['previewimage']);
if(is_array($imageinfo))
{
to
if(is_resource($sprite) AND $article['previewimage'] )
{
if(substr($article['previewimage'],0,10) == 'attachment')
{
$article['previewimage'] = 'http://www.your_site/' . $article['previewimage'];
};
$imageinfo = getimagesize($article['previewimage']);
if(is_array($imageinfo))
{
with 'your_site' beeing your site. ;)
I can confirm this worked for me on a 4.1.11 installation. Thanks!
romaszek
03-08-2012, 07:54 AM
Mooff, I Made all, then it {he, she} does not work for me - vB 4.1.11
DEBUG MODE is ON!
slider_img_filepath: external/unitedforum/slider/
width: 470 height: 272
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: external/unitedforum/slider/uf_fallback_slider.png
#img: 5
description_length: 95
directory /home/utwory/public_html/r
Warning: getimagesize() [function.getimagesize]: php_network_getaddresses: getaddrinfo failed: Name or service not known in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Warning: getimagesize(http://www.your_site/attachment.php?attachmentid=34&cid=24) [function.getimagesize]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.http://www.your_site/attachment.php?attachmentid=34&cid=24
romaszek
03-09-2012, 07:14 PM
Sorry,
it already works :)
Thanks
clubvr4
03-19-2012, 12:37 PM
I received a question via private message about slider timings. Since that might interest other site owners aswell.
How do I slow down the image timings, at the moment its a bit fast?
Answer:
That is a setting for the nivo slider: http://nivo.dev7studios.com/#usage
There you can see what you can change. I'll give an example for the timings.
Search:
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider();
});
</script>
Replace with:
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider({
pauseTime: 6000
});
});
</script>
This changes the pause Time between slides from 3 seconds to 6 seconds.
@croft
please go through the faq and post the debug you get (last question) if the other questions do not help.
It does look like a combination of a jquery (either to many jquery files or old jquery version or no jquery at all) issue and some problems with saving the resized image to file. Debug will help with the last one. If you can't find the jquery problem a link to the site where the slider is implemented would help.
Cheers
It took me a little while to find (http://nivo.dev7studios.com/support/jquery-plugin-usage/) all the options, so thought i'd share.
effect: 'random', // Specify sets like: 'fold,fade,sliceDown'
slices: 15, // For slice animations
boxCols: 8, // For box animations
boxRows: 4, // For box animations
animSpeed: 500, // Slide transition speed
pauseTime: 3000, // How long each slide will show
startSlide: 0, // Set starting Slide (0 index)
directionNav: true, // Next & Prev navigation
directionNavHide: true, // Only show on hover
controlNav: true, // 1,2,3... navigation
controlNavThumbs: false, // Use thumbnails for Control Nav
controlNavThumbsFromRel: false, // Use image rel for thumbs
controlNavThumbsSearch: '.jpg', // Replace this with...
controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
keyboardNav: true, // Use left & right arrows
pauseOnHover: true, // Stop animation while hovering
manualAdvance: false, // Force manual transitions
captionOpacity: 0.8, // Universal caption opacity
prevText: 'Prev', // Prev directionNav text
nextText: 'Next', // Next directionNav text
randomStart: false, // Start on a random slide
beforeChange: function(){}, // Triggers before a slide transition
afterChange: function(){}, // Triggers after a slide transition
slideshowEnd: function(){}, // Triggers after all slides have been shown
lastSlide: function(){}, // Triggers when last slide is shown
afterLoad: function(){} // Triggers when slider has loaded
initiald
03-28-2012, 07:42 AM
Can anyone confirm this work with Vbulletin 4.1.11?
HellRZR
03-28-2012, 09:31 PM
Good day,
I have a strange problem that reading all the post and the FAQ I couldn't find n answer. I couldn't get the images to display, my articles where using attachments, I changed the image from attachment to a fixed image via an IMG tag and the image finally showed up. But not, when I select the READ MORE, it points to the wrong link?
The article resides at www.mywebsite.com/forums//content.php?articlename
however the read more link points to :
www.mywebsite.com/content.php?articlename?
Also I would want to change "value/relevance function" to pick up the last 10 articles posted regardless of comments.
Great mod and thank-you for all the support you have been providing.
initiald
03-30-2012, 08:15 AM
Is there anyway to make it auto resize to fit when I shrink the browser? Thanks!
Hi,
i get this error in the debug info: Warnung: getimagesize(attachment.php?attachmentid=5073&cid= 18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code (Zeile 133)
Error occurred: picture is not readable.attachment.php?attachmentid=5073&cid=18
if i try to open the attatchment here monkeydesk.at/attachment.php?attachmentid=5073&cid=18 the link gets redirected by vbseo. i think thats the problem. do you have a idea how i can fix this? thx :)
AaronMiller
04-06-2012, 03:05 PM
First, I would like to say thank you for such a fantastic mod.
Second, I was wondering if it is possible to select a specific article (a welcome article) to display first in the rotation and then allow the rest of the articles to be pulled dynamically?
I looked at the FAQs but I didn't see anything quite like this. Thank you for your assistance.
basilrath
04-06-2012, 03:12 PM
Just worth mentioning the codeline
PHP Code:
$article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $article['nodeid'] . '" /></a>';
youl probably have to drop the r= out for direct links to be achieved correctly
avitor
04-09-2012, 03:43 PM
installed all as the guide and i can't make the images to show up
just the image not show
any help to fix this please ?
this steps i dan
1 downloaded and upload the folders and files to the defoult direction as your guide in top of this thread
created widget php direct ->copy and paste the widget cod >edited the bsckground image direction(the background image shows fine.)
my site can find here
www.horadot.co.za
i see in this thread few people have same problem like my one.and the stop to ask after time that the problem not be resolved.
thanks loot for this mod what i m sure that is works fine.just need to know litle more about php
or beter den me
maybe i can ask for professional to help me .i can pay
thanks
Reycer
04-09-2012, 04:57 PM
The only thing I can get is the fallback image. I have set the folder to 777 read/write, but nothing no matter what I do I get no image from the articles.
Here's my Debug Message:
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 950 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/content/87/9173587/html
Warning: getimagesize(http://www.xxxx.com/sliderattachment.php?attachmentid=45&cid=24) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.http://www.xxxx.com/sliderattachment.php?attachmentid=45&cid=24
Warning: getimagesize(http://www.xxxx.com/sliderattachment.php?attachmentid=44&cid=24) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 137
Error occurred: picture is not readable.http://www.xxxx.com/sliderattachment.php?attachmentid=44&cid=24
#articles - featured and databasepull int(2) int(2)
tintin74
04-10-2012, 07:30 AM
Try with this code:
//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 = 'external/unitedforum/slider/';
//picture width and height !same as in the CSS FILE!
$maxwidth = 650;
$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 = 10;
//lengh in characters of the article descriptions
$description_length = 95;
//stretch picture or crop them? false = strechting (default) true = cropping (beta)
$crop = false;
//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 "Strech or Crop? $crop <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) .'
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'] )
{
if(substr($article['previewimage'],0,10) == 'attachment')
{
$article['previewimage'] = 'http://www.ilgiramondo.net/forum/' . $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 rel="nofollow" href="/forum/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '">Leggi Tutto...</a>';
$article_neu['htmlcaptionname'] = 'htmlcaption' . $i ;
$article_neu['picture'] = '<a rel="nofollow" href="/forum/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. 'slider.css" type="text/css" media="screen" />
<link rel="stylesheet" href="' .$slider_img_filepath. '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-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() {
$("#slider").nivoSlider();
});
</script>
</div>
';
$output = $output_bits;
if($debug_modus === false)
{
ob_end_clean();
}
Reycer
04-10-2012, 04:14 PM
Figured out that it is my hosting company. I had to rewrite my php.ini file and make a php5.ini. Allowing URL_fopen. So far still hasn't worked though. I'm about to give up on this hosting company and go with another. argh.
avitor
04-13-2012, 08:38 AM
Figured out that it is my hosting company. I had to rewrite my php.ini file and make a php5.ini. Allowing URL_fopen. So far still hasn't worked though. I'm about to give up on this hosting company and go with another. argh.
how you make this ini change ? can you give me more details please ?
possible i have same problem
i tray to install this mod on my forum cms and can't find how to show the images.
i ask for help from decoder and is not responds no p.m not mail an visit in site registered and ask for help
no respond
then i ask for PAY work
offer money for install this mod
few cool professional vbulletin supporters and programmers take the job bat after two weeks of try to make this mod to show images
in the end some of this programers tel me that the is possible the problem is not in configuration.the problem is in the php files conf
i think i give up from try install it my self
this mod not works with vb 4.1.11 . 12
or anyone think different ?
really need this mod
thanks
Reycer
04-15-2012, 10:35 PM
I got it working. Had to add a file called php5.ini and add
allow_url_fopen on
basilrath
04-23-2012, 10:03 AM
The mod does not work with 4.1.12
jack-d
04-24-2012, 12:07 AM
The mod does not work with 4.1.12
Well it is working fine for me on 4.1.12 and now 4.1.12 PL1
basilrath
04-24-2012, 04:29 PM
As soon as i went to 4.1.12 the fall back image is all that renders on slider where as before there was no issues
Im not lying
Just a simple observation
antonrangel
04-28-2012, 11:42 PM
Well it is working fine for me on 4.1.12 and now 4.1.12 PL1
As soon as i went to 4.1.12 the fall back image is all that renders on slider where as before there was no issues
Im not lying
Just a simple observation
So how do I make it work on 4.1.12 PL1? I made everything correct (i think).
Here, it only appears the arrays. The widget box is appearing with the arrays, but the images and the written texts aren't. Here's my debug message:
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/(xxxxx)/public_html/forum
Warning: array_multisort() [function.array-multisort]: Argument #1 is expected to be an array or a sort flag in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 109
#articles - featured and databasepull int(0) int(0)
OBS: The "(xxxxx)" I changed for security.
Thanks ;]
The Rocketeer
04-30-2012, 04:55 AM
As soon as i went to 4.1.12 the fall back image is all that renders on slider where as before there was no issues
Im not lying
Just a simple observation
Yes you are lying!
This is a lye! This is not True? :confused:
:p I haven't been able to make the slider work properly since vB 417 :(
Ramsesx
04-30-2012, 10:57 AM
As soon as i went to 4.1.12 the fall back image is all that renders on slider where as before there was no issues
Im not lying
Just a simple observation
https://vborg.vbsupport.ru/showpost.php?p=2318586&postcount=429
antonrangel
05-01-2012, 09:51 PM
I made some changes, now my slider only renders fall back image.
I've tryed the code posted above, but start to bug more.
What can I do now?
basilrath
05-02-2012, 06:44 AM
Same here..................
Wizza
05-07-2012, 02:40 PM
I really wanted to use this but when I installed it the articles was all showing in a row in the box and the images was at the top but not as images - as broken image icons.
Any help?
My debug info is:
DEBUG MODE is ON!
slider_img_filepath: /home/XXXXX/public_html/slider/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: /home/XXXXXX/public_html/slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/XXXXXX/public_html
Warning: getimagesize(attachment.php?attachmentid=43&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=43&cid=24
Warning: getimagesize(attachment.php?attachmentid=42&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=42&cid=24
Warning: getimagesize(attachment.php?attachmentid=41&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=41&cid=24
Warning: getimagesize(attachment.php?attachmentid=40&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=40&cid=24
Warning: getimagesize(attachment.php?attachmentid=39&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=39&cid=24
Warning: getimagesize(attachment.php?attachmentid=38&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=38&cid=24
Warning: getimagesize(attachment.php?attachmentid=37&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=37&cid=24
Warning: getimagesize(attachment.php?attachmentid=36&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=36&cid=24
#articles - featured and databasepull int(8) int(8)
basilrath
05-07-2012, 04:47 PM
Same issues on the new software so dropped onto
https://vborg.vbsupport.ru/showthread.php?t=268817&page=18
MaxLiao
05-14-2012, 12:54 PM
I do see the fallback image, but I am not seeing the actual preview images.
Q: Captions appear and the slider works, but i can't see images
A:
- Do the images show up in the folder you specified? NO
- Does the fallback image show up if you set the switch to yes? YES
I made the change as indicated HERE ('https://vborg.vbsupport.ru/showpost.php?p=2305905&postcount=410'), and we still have the same issue - with this log as the result.
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /***/***/***/***/***/lom_vB4
Error occurred: picture is not readable.http://legionofmyth.com/attachment.php?attachmentid=21&cid=24
Error occurred: picture is not readable.http://legionofmyth.com/attachment.php?attachmentid=20&cid=24
#articles - featured and databasepull int(2) int(10)
I also verified the following:
I got it working. Had to add a file called php5.ini and add
allow_url_fopen on This command is set to on.
If I just simply follow the URL in a browser (http://legionofmyth.com/attachment.php?attachmentid=21&cid=24) it works just fine.
Website URL: http://legionofmyth.com
Crotan
05-18-2012, 12:08 AM
I do see the fallback image, but I am not seeing the actual preview images.
I made the change as indicated HERE ('https://vborg.vbsupport.ru/showpost.php?p=2305905&postcount=410'), and we still have the same issue - with this log as the result.
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /***/***/***/***/***/lom_vB4
Error occurred: picture is not readable.http://legionofmyth.com/attachment.php?attachmentid=21&cid=24
Error occurred: picture is not readable.http://legionofmyth.com/attachment.php?attachmentid=20&cid=24
#articles - featured and databasepull int(2) int(10)
I also verified the following:
This command is set to on.
If I just simply follow the URL in a browser (http://legionofmyth.com/attachment.php?attachmentid=21&cid=24) it works just fine.
Website URL: http://legionofmyth.com
If I follow that attachment URL I get Invalid Attachment specified. If you followed a valid link, please notify the administrator
Did you try making attachments visible to guests? Like it says in the FAQ
Q: Attachments aren't working for me
A: If your guests do not have the rights to see attachments - neither does the slider.
MaxLiao
05-18-2012, 07:35 AM
So, I checked the permissions - I knew I had changed them to allow guests to d/l attachments. Well, I was only partially right. I had changed the usergroup and the individual forum permissions, but I had not changed the vBulletin CMS permissions. Once I changed the permissions there the mod is working.
Thank you.
mjay1113
05-27-2012, 02:50 AM
does this work on VB4.2? I uploaded the files and widget but nothing appears..
Losias
05-31-2012, 12:26 PM
does this work on VB4.2? I uploaded the files and widget but nothing appears..
Same here. Nothing appears for me since 4.2.
Here is the debug code.
slider_img_filepath: nivoslider/
width: 1024 height: 250
Strech or Crop?
show_articles_without_image: bool(true)
fallback_img: nivoslider/uf_fallback_slider.png
#img: 10
description_length: 180
directory /home/XXXXXX/public_html
Warning: getimagesize(attachment.php?attachmentid=39&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=39&cid=24
Warning: article has no previewimage or sprite is no ressource.
Warning: article has no previewimage or sprite is no ressource.
#articles - featured and databasepull int(9) int(9)
zooki
06-08-2012, 05:21 PM
Got it to work, just can not see the images..... :S
iM on 4.2
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory /mnt/Target01/323293/www.mywebsite.com/web/content
Error occurred: picture is not readable.attachment.php?attachmentid=51&cid=24
Error occurred: picture is not readable.attachment.php?attachmentid=50&cid=24
Error occurred: picture is not readable.attachment.php?attachmentid=45&cid=24
Error occurred: picture is not readable.attachment.php?attachmentid=41&cid=24
Error occurred: picture is not readable.attachment.php?attachmentid=38&cid=24
Error occurred: picture is not readable.attachment.php?attachmentid=37&cid=24
Error occurred: picture is not readable.attachment.php?attachmentid=36&cid=24
Error occurred: picture is not readable.attachment.php?attachmentid=35&cid=24
#articles - featured and databasepull int(8) int(9)
allow_url_fopen is ON
charlesr
06-15-2012, 11:51 PM
Same issue here. Using another temporarily, but would like to come back to this one when fixed.
MaxLiao
06-24-2012, 02:38 PM
I haven't started to use another one yet, but I'm considering doing that in the near future.
I like this one, and will stick with it until I just can't do it anymore, so hopefully it gets an update soon. :)
[EDIT]
I just updated to PHP 5.3 and made one php.ini config change allow_url_fopen = On and now this mod (and everything else) on my site seems to be working perfectly. I don't know if it will help anyone else, but that did the trick for me.
Naijasite
06-26-2012, 11:25 PM
I have installed the slider on my forum (http://www.naijafinder.com/content/) and it's working fine. But the slider is unable to pull thumbnail images from the Article.http://www.naijafinder.com/content/
Note: All my Article images are not uploaded images but they are copied and past into the Article.
The slider default images it's showing on my forum but can't pull my Article images.
Please how do i make the slider to pull thumbnail images from my Articles (http://www.naijafinder.com/content/).
charlesr
06-27-2012, 09:05 AM
Your site is running 4.2
This slider does not work without modification on 4.2 (see recent posts)
forumistat
06-29-2012, 01:21 PM
Can someone help me set up this slider i only get a blank white box with nothing on it...
manyaa
07-25-2012, 07:29 PM
1. My nivo-slider files and fallback_slider.png are at this location: ..stories.com/forum/slider/
2. Similarly all my VB files for cms, blog, forum are in: ..stories.com/forum/
( meaning slider and all files are in a folder named forum.)
3. I created php widget by making following changes in your code:
$fallback_img = $slider_img_filepath . 'fallback_slider.png';
$slider_img_filepath = '/slider/';
4. But the linked images and linked articles are not showing up. They are being linked as follows:
..stories.com/content.php?r=50-destination
..stories.com/slider/fallback_slider.png
5. While the actual location of articles and images are:
..stories.com/forum/slider/fallback_slider.png
..stories.com/forum/content.php?r=50-destination
6. Question: Where and what change should I be making to correct this problem? Thank you so much for your help.
dormopoco
08-11-2012, 03:21 PM
A little question: Hot to storage image in folder /images/ ad script in another folder?
image in clientscript/slider/images/
script in clientscript/slider/
tnx for support
And how to setup only fade effect?
Elenna
08-11-2012, 08:40 PM
Personally I would recommend NOT storing the images in the clientscript folder. That's a rather sensitive folder that should remain secure, so I wouldn't have a folder in there (images) that is chmod 777.
Either way, I think the mod is hard-coded to assume that the script and image directory is the same, and you'd need to change a bunch of stuff. IMHO it's just easier to follow the instructions and leave both in the same folder.
dormopoco
08-12-2012, 06:36 AM
Personally I would recommend NOT storing the images in the clientscript folder. That's a rather sensitive folder that should remain secure, so I wouldn't have a folder in there (images) that is chmod 777.
TNX for support
I tried and tried but I can not only set the fade effect.
Elenna
08-12-2012, 02:06 PM
TNX for support
I tried and tried but I can not only set the fade effect.
Do you mean that it isn't transitioning between images at all? Or it IS pulling your images successfully, but that you only want to have it do the "Fade" effect and not any of the other ones?
If you only want the fade effect, edit your widget code like this:
Find:
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider();
});
</script>
Replace with:
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider({
effect: 'fade' // Specify sets like: 'fold,fade,sliceDown'
});
});
</script>
The available "options" for the red text are:
sliceDo
wn
sliceDownLeft
sliceUp
sliceUpLeft
sliceUpDown
sliceUpDownLeft
fold
fade
random
slideInRight
slideInLeft
boxRandom
boxRain
boxRainReverse
boxRainGrow
boxRainGrowReverse
You can choose more than one by putting a comma between them (like effect: 'fade, sliceUp, boxRain').
Another quick tip, if you want to have it re-get your article images, you can either FTP into that images folder and delete any of the article___ ones, OR edit the widget and change the cache time to a low number (like 1 minute). Don't forget to change it back. :)
dormopoco
08-12-2012, 06:33 PM
Do you mean that it isn't transitioning between images at all? Or it IS pulling your images successfully, but that you only want to have it do the "Fade" effect and not any of the other ones?
If you only want the fade effect, edit your widget code like this:
Find:
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider();
});
</script>
Replace with:
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider({
effect: 'fade' // Specify sets like: 'fold,fade,sliceDown'
});
});
</script>
Not Working, :-( whit this code i see only one line. Solved now the correct code is:
<script type="text/javascript">
$(window).load(function() {
$("#slider").nivoSlider({
effect: "fade"
});
});
</script>
Elenna
08-12-2012, 11:03 PM
Hmm, strange. The only difference is removing the "Specify sets...." comment? Wouldn't have thought that would matter.
Glad you got it working, though!
dormopoco
08-13-2012, 11:17 AM
The differense is:
'fade'
to
"fade"
Elenna
08-13-2012, 01:09 PM
haha Oops, thanks. :)
dormopoco
08-13-2012, 01:16 PM
TNx at you.
Elenna
08-14-2012, 01:54 AM
I'm not sure if this has been mentioned before, but I adapted code from this site (http://www.php.net/manual/en/function.imagecopyresampled.php#94251) to make it crop your Slider image from the direct center of the article image.
I really can't give support for this, since I barely managed to figure it out myself, but if you DO give it a try, let us know if it works!
// 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 = 'slider/';
//picture width and height !same as in the CSS FILE! - was 650
$maxwidth = 385;
$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 . 'Fallback.jpg';
//hardcoded maximum is 20 - if you want more just ask
$number_of_articles_shown = 10;
//lengh in characters of the article descriptions - was 95
$description_length = 50;
//stretch picture or crop them? false = strechting (default) true = cropping (beta)
$crop = true;
//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 "Strech or Crop? $crop <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) .'
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)
{
if($debug_modus == true OR !file_exists($slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg'))
{
//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'] )
{
if(substr($article['previewimage'],0,10) == 'attachment')
{
$article['previewimage'] = 'http://uat.echoesoftyria.com/' . $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.
echo '<span style="color:red">Error occurred:</span> imagecreation failed. ' . $article['previewimage']. '<br />';
$article['previewimage'] = $fallback_img;
}
else
{
$img_width = $imageinfo[0];
$img_height = $imageinfo[1];
if($crop == false)
{
imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
imagedestroy($image);
}
else
{
//cropping
$ratiox = $maxheight / $img_height ;
$ratioy = $maxwidth / $img_width ;
$new_height = $img_height;
$new_width = $img_width;
if ($maxheight > $img_height OR $maxwidth > $img_width)
{
if($ratiox > $ratioy)
{
$new_height = round($img_height * $ratiox);
$new_width = round($img_width * $ratiox);
}
else
{
$new_height = round($img_height * $ratioy);
$new_width = round($img_width * $ratioy);
}
}
$x_mid = $new_width/2; //horizontal middle - NEW CODE
$y_mid = $new_height/2; //vertical middle - NEW CODE
// WAS $cropx = $new_height - $maxheight
// WAS $cropy = $new_width - $maxwidth
// WAS: imagecopyresampled($sprite, $image, 0, 0, 0, 0, $new_width, $new_height, $img_width, $img_height);
imagecopyresampled($sprite, $image, 0, 0, ($x_mid-($maxwidth/2)), ($y_mid-($maxheight/2)), $img_width, $img_height, $img_width, $img_height); // NEW CODE
imagedestroy($image);
}
$img_filepath = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.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.
echo '<span style="color:red">Error occurred:</span> picture is not readable.' . $article['previewimage']. '<br /> ';
$article['previewimage'] = $fallback_img;
}
}
else
{
//resiziing did not work - we are using the fallback image.
echo '<span style="color:red">Warning:</span> article has no previewimage or sprite is no ressource. ' . $article['previewimage']. '<br />';
$article['previewimage'] = $fallback_img;
}
}
else
{
//we already have the image, no need to resize or crop anything
$article['previewimage'] = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg';
}
/*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' . $article['nodeid'] ;
$article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $article['nodeid'] . '" /></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-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() {
$("#slider").nivoSlider();
});
</script>
</div>
';
$output = $output_bits;
if($debug_modus === false)
{
ob_end_clean();
}
Elenna
08-15-2012, 01:35 AM
Arg, I'm not sure what I did! I have two sites, a test site and a live site (which we are getting ready to launch).
Now the Test site was an upgrade from a 4.1 board, but Live site is a fresh 4.2 install. They are using the same hosting company and both using the php.ini and php5.ini.
On my Test site things are working great. On Live, I'm getting the dreaded "Blank Box", with no images and no article text. The arrows show up and when using the Inspect Element (in Chrome) I see the script "running" and trying to switch between things.
Images are not being saved to the directory, and the fallback image isn't being used.
I triple-checked and the files and code are the exact same between my test and live sites.
My CMS permissions are the same (allow guests to download attachments). I re-copied the "no background" template.
My file permissions are the same between sites, and I'm not referencing the test site in any way.
The source code on my Test site references one jQuery line from Google, but that isn't interfering with the Test site. For kicks I copied the line into Live, and it still didn't work.
PROBLEM FIXED - please see my next post.
Elenna
08-15-2012, 05:38 PM
I found and fixed my issue!! After running various queries based on the code, I figured out that it only shows articles with a Publish Date of the last 12-13 months. Since we are still building our Live site, we were testing with a few older articles, with Publish Dates in 2010.
Once I changed the dates to something more recent - voila! I have a slider. :)
Hope this helps someone else some day.
bintoro
08-22-2012, 12:23 PM
:( I give up after six month on how to figure out slider in cms. Uninstalled and thanks.
DemoVFW
08-28-2012, 09:37 PM
Can anyone make this work for 4.2? It's exactly what I need. I'll pay for help. PM me if interested. Thanks.
basilrath
08-28-2012, 09:53 PM
use the vf coders slide its effective
DemoVFW
08-29-2012, 01:40 AM
use the vf coders slide its effective
Thanks for the suggestion, but I really prefer the look of this one. Thanks though.
MaxLiao
08-31-2012, 05:13 AM
So, my slider stopped working. For various reasons it took a while for me to discover this sad fact. After going through all of the troubleshooting steps I was about ready to remove this dang slider mod and try something else. As a last resort, I checked my php.ini file. Right away this jumped out at me: it was set to version 5.2.
Due to some other troubleshooting, my webhost changed my PHP version back to 5.2 (without telling me). I bumped that baby back up to version 5.3 and the slider is working great! I don't claim this will work for everyone, but if you're having troubles, check it out.
I just updated to PHP 5.3 and made one php.ini config change allow_url_fopen = On and now this mod (and everything else) on my site seems to be working perfectly. I don't know if it will help anyone else, but that did the trick for me.
initiald
09-01-2012, 09:01 AM
Yeah this work on 4.2. I have it going smoothly.
Jamie G
09-01-2012, 11:03 PM
I cannot get this working on 4.2.0. I get the slider, the animation and the full bck image and the article text. However, I cannot get the images to display.
Additionally, the images link incorrectly. My site is stored in a folder, not root.
So, my installation is in root/V2. Article links point to domain.com/v2/content.php - but the slider points to domain.com/content.php - does this plugin not work unless the vB install is in the root?
Hopefully someone can help ASAP.
dormopoco
09-03-2012, 10:32 AM
Not Working whit vbulletin 4.2.0 can't open attachment error. My code is:
// 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/slider/';
//picture width and height !same as in the CSS FILE!
$maxwidth = 470;
$maxheight = 300;
//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 = 10;
//lengh in characters of the article descriptions
$description_length = 95;
//stretch picture or crop them? false = strechting (default) true = cropping (beta)
$crop = true;
//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 "Strech or Crop? $crop <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
category.categoryid IN ( 54 )
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)
{
if($debug_modus == true OR !file_exists($slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg'))
{
//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.
echo '<span style="color:red">Error occurred:</span> imagecreation failed. ' . $article['previewimage']. '<br />';
$article['previewimage'] = $fallback_img;
}
else
{
$img_width = $imageinfo[0];
$img_height = $imageinfo[1];
if($crop == false)
{
imagecopyresampled($sprite, $image, 0, 0, 0, 0, $maxwidth, $maxheight, $img_width, $img_height );
imagedestroy($image);
}
else
{
//cropping
$ratiox = $maxheight / $img_height ;
$ratioy = $maxwidth / $img_width ;
$new_height = $img_height;
$new_width = $img_width;
if ($maxheight > $img_height OR $maxwidth > $img_width)
{
if($ratiox > $ratioy)
{
$new_height = round($img_height * $ratiox);
$new_width = round($img_width * $ratiox);
}
else
{
$new_height = round($img_height * $ratioy);
$new_width = round($img_width * $ratioy);
}
}
$cropx = $new_height - $maxheight;
$cropy = $new_width - $maxwidth;
imagecopyresampled($sprite, $image, 0, 0, 0, 0, $new_width, $new_height, $img_width, $img_height);
imagedestroy($image);
}
$img_filepath = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.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.
echo '<span style="color:red">Error occurred:</span> picture is not readable.' . $article['previewimage']. '<br /> ';
$article['previewimage'] = $fallback_img;
}
}
else
{
//resiziing did not work - we are using the fallback image.
echo '<span style="color:red">Warning:</span> article has no previewimage or sprite is no ressource. ' . $article['previewimage']. '<br />';
$article['previewimage'] = $fallback_img;
}
}
else
{
//we already have the image, no need to resize or crop anything
$article['previewimage'] = $slider_img_filepath . 'slide_' . $article['nodeid'] . '.jpg';
}
/*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'] . '">Leggi Altro</a>';
$article_neu['htmlcaptionname'] = 'htmlcaption' . $article['nodeid'] ;
$article_neu['picture'] = '<a href="/content.php?r=' . $article['nodeid'] . '-' . $article['url'] . '"><img src="'.$article['previewimage'].'" alt="" title="#htmlcaption'. $article['nodeid'] . '" /></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-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() {
$("#slider").nivoSlider({
effect: "fade"
});
});
</script>
</div>
';
$output = $output_bits;
if($debug_modus === false)
{
ob_end_clean();
}
JAnders
09-26-2012, 06:26 PM
try doing:
$slider_img_filepath = '/clientscript/slider/';
JAnders
09-26-2012, 06:32 PM
I cannot get this working on 4.2.0. I get the slider, the animation and the full bck image and the article text. However, I cannot get the images to display.
Additionally, the images link incorrectly. My site is stored in a folder, not root.
So, my installation is in root/V2. Article links point to domain.com/v2/content.php - but the slider points to domain.com/content.php - does this plugin not work unless the vB install is in the root?
Hopefully someone can help ASAP.
I have the same problem but a bit different in the img_dir I have
$slider_img_filepath = '/foros/slideshow/';
this works as it executes the jscript and displays the articles with the default image however the article images/attachments do not display when I look at the debug code the absolute path that it shows is incorrect as it shows /sitehomedir/foros/foros/slideshow/ and of course it doesn't find the images there.
if I change the img_filepath to remove the duplicate foros entry like this:
$slider_img_filepath = '/slideshow/';
then it doesn't find the rest of the script and only it looks worst.
this sounds like an easy fix but I just don't know where to specify the full server path even if I hardcode it in.
JAnders
09-26-2012, 07:21 PM
this is the output from my debug file:
Warning: getimagesize(attachment.php?attachmentid=1043&cid= 24) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=1043&cid=24
Warning: getimagesize(attachment.php?attachmentid=1054&cid= 24) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=1054&cid=24
Warning: getimagesize(attachment.php?attachmentid=1049&cid= 24) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=1049&cid=24
Warning: getimagesize(attachment.php?attachmentid=1045&cid= 24) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=1045&cid=24
Warning: getimagesize(attachment.php?attachmentid=1042&cid= 24) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=1042&cid=24
Warning: getimagesize(attachment.php?attachmentid=1037&cid= 24) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=1037&cid=24
Warning: getimagesize(attachment.php?attachmentid=1029&cid= 24) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=1029&cid=24
Warning: getimagesize(attachment.php?attachmentid=1026&cid= 24) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=1026&cid=24
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/foros/slideshow/slide_134.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://sphotos-b.xx.fbcdn.net/hphotos-ash4/404066_480548928630053_423049842_n.jpg
directory: /home/content/s/i/a/siaar/html/fifamexico/foros/foros/slideshow/slide_134.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/foros/slideshow/slide_133.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 200
Error occurred: imagejpeg failed. http://sphotos-a.xx.fbcdn.net/hphotos-ash3/601400_462243877129771_376031935_n.jpg
directory: /home/content/s/i/a/siaar/html/fifamexico/foros/foros/slideshow/slide_133.jpg
JAnders
09-27-2012, 03:17 PM
alright after various trials and errors i got it to kinda work, never found how to fix the issue with attachments but I figured out a way around that
this is how it looks now:
www.fifamexico.net/foros
ar15dcm
09-30-2012, 07:38 AM
I didnt go through all 32 pages, but can the image be displayed as its original size to prevent distortion?
intruder
01-22-2013, 07:09 AM
Php Info:
allow_url_fopen On
Vbulletin CMS > Permisions > Slider Specific Section > Can Download Attachments > All
Usergroups > Unregistred users > Forum Viewing Permissions > Forum Viewing Permissions > Can Download Attachments > YES
Unlogged www.mysite.com/attachment.php?attachmentid=494&cid=18 - attachment is working fine
EBUG MODE is ON!
slider_img_filepath: /slider/
width: 650 height: 351
Strech or Crop? 1
show_articles_without_image: bool(false)
fallback_img: /slider/uf_fallback_slider.png
#img: 2
description_length: 95
directory /home/raptor/html/www.mysite.com
Warning: getimagesize(attachment.php?attachmentid=494&cid=18): failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 135
Error occurred: picture is not readable.attachment.php?attachmentid=494&cid=18
Warning: getimagesize(attachment.php?attachmentid=487&cid=18): failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 135
Error occurred: picture is not readable.attachment.php?attachmentid=487&cid=18
#articles - featured and databasepull int(2) int(14)
Slider folder:
Chown apache.apache
Chmod 775
$slider_img_filepath = '/slider/'; is correct
Still getting that error... any ideeas?
Charis
02-15-2013, 08:45 AM
After upgrading to ver. 4.2 PL3 from 4.1.10, the slider doesn' t pull images from the articles.
I have PHP 5.3.10.
I did add "allow_url_fopen = On" in php.ini.
Charis
02-19-2013, 04:57 AM
Anyone who can help with this issue?
b0wlninja
02-19-2013, 02:50 PM
hey i got a quick question i installed the php widget but none of my images are showing up or the sprites for the slider but i can still see the html message o and im trying to use this on the CMS
Naijasite
03-16-2013, 07:15 PM
How do i make the slider to use photo posted through rss feed.
If my content was posted by rss feed with photo, can the slider use the rss photo?
whitedd
04-07-2013, 01:21 AM
vbulletin 4.2.0
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 600 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 20
description_length: 95
directory /home2/branitel/public_html
Warning: getimagesize(attachment.php?attachmentid=19417&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19417&cid=18
Warning: getimagesize(attachment.php?attachmentid=19424&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19424&cid=18
Warning: getimagesize(attachment.php?attachmentid=19394&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19394&cid=18
Warning: getimagesize(attachment.php?attachmentid=19422&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19422&cid=18
Warning: getimagesize(attachment.php?attachmentid=19392&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19392&cid=18
Warning: getimagesize(attachment.php?attachmentid=19421&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19421&cid=18
Warning: getimagesize(attachment.php?attachmentid=19418&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19418&cid=18
Warning: getimagesize(attachment.php?attachmentid=19416&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19416&cid=18
Warning: getimagesize(attachment.php?attachmentid=19415&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19415&cid=18
Warning: getimagesize(attachment.php?attachmentid=19414&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19414&cid=18
Warning: getimagesize(attachment.php?attachmentid=19413&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19413&cid=18
Warning: getimagesize(attachment.php?attachmentid=19412&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19412&cid=18
Warning: getimagesize(attachment.php?attachmentid=19410&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19410&cid=18
Warning: getimagesize(attachment.php?attachmentid=19409&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19409&cid=18
Warning: getimagesize(attachment.php?attachmentid=19408&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19408&cid=18
Warning: getimagesize(attachment.php?attachmentid=19407&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19407&cid=18
Warning: getimagesize(attachment.php?attachmentid=19406&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19406&cid=18
Warning: getimagesize(attachment.php?attachmentid=19398&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19398&cid=18
Warning: getimagesize(attachment.php?attachmentid=19393&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19393&cid=18
Warning: getimagesize(attachment.php?attachmentid=19391&cid =18) [function.getimagesize]: failed to open stream: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=19391&cid=18
#articles - featured and databasepull int(20) int(20)
how to fix plsssssssssssssssssss?
whitedd
04-09-2013, 10:01 PM
..never mind...i do something ( i dont know what...hahaha), but now its working...thnx...nominated... ;)
ananto
05-30-2013, 06:53 AM
Hi Moof,
this is my debug code:
DEBUG MODE is ON!
slider_img_filepath: slider/
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: slider/uf_fallback_slider.png
#img: 10
description_length: 95
directory C:\DWASFiles\Sites\unibosca30\VirtualDirectory0\si te\wwwroot
Error occurred: picture is not readable.attachment.php?attachmentid=251&cid=51
Error occurred: picture is not readable.attachment.php?attachmentid=241&cid=51
Error occurred: picture is not readable.attachment.php?attachmentid=161&cid=51
Error occurred: picture is not readable.attachment.php?attachmentid=151&cid=51
#articles - featured and databasepull int(4) int(4)
MissKalunji
06-23-2013, 12:39 AM
so :) it's working however the images aren't showing. only YOURS is showing the one advertising your forum...what did i possibly do wrong?
my images aren't in my database but file system.
CGhostGroup
06-25-2013, 05:38 PM
If you upload always a picture in the right size, u can change the following code to always use the attachment.
from:
$article['previewimage'] = $fallback_img;
to:
$article['previewimage'] = '/here the path to your root-folder with the attachment.php inside/'.$article['previewimage'];
MissKalunji
06-26-2013, 02:12 AM
alright after various trials and errors i got it to kinda work, never found how to fix the issue with attachments but I figured out a way around that
this is how it looks now:
www.fifamexico.net/foros
care to share what you did? :)
lgfilmfest
07-01-2013, 02:40 AM
Hi, I am having a little trouble with the slider. I'm on vb 4.2.1. I have checked to make sure the folder image path is right and it is. Its doing this when I use the widget, the images aren't showing and it looks well dumb. Take a look http://puu.sh/3siqv.png
EDIT: Nevermind found the problem! The file path was wrong actual. I put it has public_html/slider/ because I copied it from the ftp like the tutorial, but it was only supposed to be slider/
K4GAP
07-01-2013, 09:24 PM
*******
EDIT: Nevermind found the problem! The file path was wrong actual. I put it has public_html/slider/ because I copied it from the ftp like the tutorial, but it was only supposed to be slider/
I would LOVE to get this working on 4.2.1
Can you please share anything that might be helpful?
lgfilmfest
07-03-2013, 02:46 PM
Ok, i'm having another problem. The images were working and everything, then I took it out of my layout for a minute put it back in and now when you refresh the page one of the images shows up for about a second and then fades and so the backgrounds black and just a caption shows up. The fall back image doesn't work and the img path is correct, so I have no clue what to do if anyone could help please.
lgfilmfest
07-03-2013, 02:47 PM
I would LOVE to get this working on 4.2.1
Can you please share anything that might be helpful?
Um sure tell me your problem, but I cannot get it working for my self too right now, but I will try to help.
enforcer786
07-29-2013, 04:03 PM
Any updates on getting this work on 4.2.1?
A Dead Puppie
12-19-2013, 04:45 AM
How can i make this work with forums not articles?
Bestrafung
07-06-2014, 07:38 PM
I have an interesting issue with this mod. I followed the steps to make it load only from selected sections, which for the time being is a single section with a single test article. When set to read the main page articles the images loaded without issue. The image on the test article however does not. I get the below error when debug is on. I have verified the attachment is viewable as a guest by using a browser that is not signed in and have checked the size limits in the attachment manager and can't determine the issue. Any assistance would be much appreciated.
DEBUG MODE is ON!
slider_img_filepath: /nivo/
width: 500 height: 250
Strech or Crop?
show_articles_without_image: bool(false)
fallback_img: /nivo/uf_fallback_slider.png
#img: 10
description_length: 95
directory /home/xxxxxxxx/public_html
Warning: getimagesize(attachment.php?attachmentid=80&cid=24 ) [function.getimagesize]: failed to open stream: No such file or directory in ..../packages/vbcms/widget/execphp.php(191) : eval()'d code on line 134
Error occurred: picture is not readable.attachment.php?attachmentid=80&cid=24
#articles - featured and databasepull int(1) int(1)
LM SpinX
11-06-2015, 10:08 PM
Not sure if anyone can help but i'm getting the same as the above:
DEBUG MODE is ON!
slider_img_filepath: /nivoslider
width: 650 height: 250
Strech or Crop?
show_articles_without_image: bool(true)
fallback_img: /nivoslideruf_fallback_slider.png
#img: 10
description_length: 95
PHP Warning: getimagesize(attachment.php?attachmentid=5&cid=24) : failed to open stream: No such file or directory in ..../packages/vbcms/widget/execphp.php(191) : eval()'d code on line 133
Error occurred: picture is not readable.attachment.php?attachmentid=5&cid=24
#articles - featured and databasepull int(1) int(1)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.