vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - United-Forum Nivo Slider Widget (https://vborg.vbsupport.ru/showthread.php?t=267024)

Mooff 07-23-2011 08:24 PM

two possibilities come to mind:
a) you do not have the jquery1.4.4.js file in the vbulletin folder
This would mean search
Code:

<script type="text/javascript" src="clientscript/jquery/jquery-1.4.4.min.js"></script>
and replace with
Code:

<script type="text/javascript" src="' .$slider_img_filepath. 'jquery-1.6.1.min.js"></script>
b) you already have a jquery version running on the page where the slider is included.
Just delete that line. Two jquery files on one page are unnecessary and unfortunately break the jquery execution.
Code:

<script type="text/javascript" src="clientscript/jquery/jquery-1.4.4.min.js"></script>
If the jquery version you are using on your website is above 1.4 - you are fine and everything should be working now.
If it isn't - update your version.

Alfa1 07-23-2011 09:31 PM

Quote:

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

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

Im afraid not. :s

SECTalk.com 07-24-2011 01:02 AM

Thanks, I had multiple (about five or 6) instances of jQuery running.

Aramist 07-24-2011 05:09 PM

Same to me =/

Everything work fine....except images, that dont appear.

=/

Mooff 07-24-2011 05:21 PM

Sorry Alfa1, i'll check that attachment issue more thouroughly sometime next week when our new cms is finally live.

@ Aramist
- please check out post #41 maybe it's a javascript thing
- or are your article images attachments
- or do the images show up in the folder you specified
- or does the fallback image work if you set this switch on yes

I'll rewrite the first post sometime around tuesday, clean it up a bit and provide a (hopefully) usefull faq in the first comment.

Aramist 07-24-2011 05:45 PM

- please check out post #41 maybe it's a javascript thing
I've already done that

- or are your article images attachments
no

- or do the images show up in the folder you specified
the folder i've specified keeps empty..

- or does the fallback image work if you set this switch on yes
It works fine

I'm sure the problem is in the image creation, cause your condition to use a sample image in case the image creation fail is working.

But i haven't figured out why... =/

=/

Ty

Mooff 07-24-2011 05:57 PM

Do you have php GD installed?
Is the folder you've specified writeable?

If both answers are yes please comment out //ob_start(); and //ob_end_clean()
and post the debug message, if there is one.

Aramist 07-24-2011 06:03 PM

Ohhh...how stupid I am..

I had removed
//picture width and height !same as in the CSS FILE!
$maxwidth = 650;
$maxheight = 250;

that was the problem...now works fine

Good jog !!

Other question:

How can i point the DB query to get article from one exclusive cms category?

Ty a lot man :D

Mooff 07-24-2011 06:17 PM

Great to hear that. =)

category or section?
i'll write down the category code (untested)
Code:

$query = sprintf("
        SELECT
            article.pagetext,
            article.previewimage,
            node.url,
            node.publishdate,
            node.parentnode,
            parentnode.url AS parenturl,
            thread.replycount,
            info.title,
            node.nodeid
        FROM
            ".TABLE_PREFIX."cms_article AS article INNER JOIN
            ".TABLE_PREFIX."cms_node AS node
                ON (node.contentid = article.contentid AND node.contenttypeid = '%d') 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
        WHERE
            nodecategory.categoryid = X AND
            node.setpublish = 1 AND
            node.publishdate > '%d' -34560000
        ORDER BY node.publishdate
        ASC LIMIT 20"
        ,$article_type,$time);

that X in
nodecategory.categoryid = X AND
is your categoryid - you have to look that one up. For example:
/content/category/31-esport.html
Category esports on our site has the ID 31.

in addition, delete that line:
Code:

        $categories = explode(',' , $article['GROUP_CONCAT( category.category )']);

Aramist 07-24-2011 06:28 PM

Oh TY !

I had to include category.categoryid in select option.

Now works like a charm !!

TY a lot Dude!

5 star rated for the mod and for the support!

Aramist 07-24-2011 06:58 PM

@ another questions :P

1 - I'm getting some charset issues on caption, I use UTF-8, but some captions are coming wrong...but original posts are ok, no issues....just on slider caption.

Edit: Just preview text are getting worng, post title is charset ok.

2 - I have verified that slide images are been created with ~200 or 300k, which is causing the slider to stuck some animations (while loading the images). Is there any way to reduce images file size?

Ty

Mooff 07-24-2011 07:12 PM

first one. Won't have time to debug that until next week. However, please give more information (what characters are the issues, what they are in your original posts -quote that part- and what they are in the caption, another quote).

second one. Sure, will be included in the next version - i used parts of the sprite code Osbes wrote for our css-sprite performance addon. There we do need transparency, so the images are saved as *.png
For the nivo slider *.jpg does make more sence and jpegs are alot smaller.

This part
Code:

                            $img_filepath = $slider_img_filepath . 'slide_' . $i . '.png';
                            $success = imagepng($sprite, DIR  . ($slider_img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath);

will be changed into this one (already implemented our version)
Code:

                            $img_filepath = $slider_img_filepath . 'slide_' . $i . '.jpg';
                            $success = imagejpeg($sprite, DIR  . ($slider_img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath);


Brexen 07-24-2011 09:03 PM

Thanks man nice :D installed <3

Aramist 07-25-2011 02:38 PM

Quote:

Originally Posted by Mooff (Post 2224448)
first one. Won't have time to debug that until next week. However, please give more information (what characters are the issues, what they are in your original posts -quote that part- and what they are in the caption, another quote).

second one. Sure, will be included in the next version - i used parts of the sprite code Osbes wrote for our css-sprite performance addon. There we do need transparency, so the images are saved as *.png
For the nivo slider *.jpg does make more sence and jpegs are alot smaller.

This part
Code:

                            $img_filepath = $slider_img_filepath . 'slide_' . $i . '.png';
                            $success = imagepng($sprite, DIR  . ($slider_img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath);

will be changed into this one (already implemented our version)
Code:

                            $img_filepath = $slider_img_filepath . 'slide_' . $i . '.jpg';
                            $success = imagejpeg($sprite, DIR  . ($slider_img_filepath[0] != DIRECTORY_SEPARATOR ?  DIRECTORY_SEPARATOR : '') . $img_filepath);


This change works great ! TY....down to 20k from 200k.


Explaining MY charset Issue:

In a Original text: " Redu??o " and " implica??es "

It shows: " Redução " and " implicações "

But it only occurs in the caption $article['previewtext'] variable .

$article['title'] variable is working fine with no charset issues.

One Question: What happens if I edit the original article and change the image? The script can handle it?

And no problem with the support time....u can help me when u have time...don't worry ! :D

Ty for your support ! :D

Mooff 07-25-2011 03:26 PM

Ah i see, the issue seems to be my version of equalizing the preview text length (which i changed numerous times along the way). Thought it would work for everything since it does work with the german special characters ? ? ? and so on.

Anyways, quick and dirty fix would be removing the equalizing part (preview length then might differ depending on how many special characters are in there, but everything should look fine then)

again, untested
Code:

                /*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['pagetext'] = strip_tags($article['pagetext']);

                $article['previewtext'] = str_replace('<br />', '', $article['pagetext']);

                $article['previewtext'] = html_entity_decode($article['previewtext']);
                $len = $description_length;
                if ( strlen($article['previewtext']) > $len )
                {                   
                    $article['previewtext'] = substr( $article['previewtext'] , 0 , strrpos( substr( $article['previewtext'], 0, $len), ' ' ));
                } 
                $article['previewtext'] = htmlentities($article['previewtext']);

changes into
Code:

                /*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['pagetext'] = strip_tags($article['pagetext']);

                $article['previewtext'] = str_replace('<br />', '', $article['pagetext']);

                $len = $description_length;
                if ( strlen($article['previewtext']) > $len )
                {                   
                    $article['previewtext'] = substr( $article['previewtext'] , 0 , strrpos( substr( $article['previewtext'], 0, $len), ' ' ));
                }


--
your other question.
The slider can handle that.

If you edit an article the next time the cms widget cache runs out the new version will be in. By the way i would strongly advise to use the widget cache on this one. Default setting there is 5min - the widget cache for the slider refreshes every 300 minutes on our website. Using the cache the load time is blazing fast. Letting the database query run, sort the articles and then resize and save a bunch of images is not so fast. ;)

Aramist 07-25-2011 04:47 PM

Quote:

Originally Posted by Mooff (Post 2224811)
Ah i see, the issue seems to be my version of equalizing the preview text length (which i changed numerous times along the way). Thought it would work for everything since it does work with the german special characters ? ? ? and so on.

Anyways, quick and dirty fix would be removing the equalizing part (preview length then might differ depending on how many special characters are in there, but everything should look fine then)

again, untested

changes into
Code:

                /*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['pagetext'] = strip_tags($article['pagetext']);

                $article['previewtext'] = str_replace('<br />', '', $article['pagetext']);

                $len = $description_length;
                if ( strlen($article['previewtext']) > $len )
                {                   
                    $article['previewtext'] = substr( $article['previewtext'] , 0 , strrpos( substr( $article['previewtext'], 0, $len), ' ' ));
                }


Again..... works like a charm !!! :D

Ty a lot..

Now i'll sit here and wait you bring us the next version with attach working !! :DD

A Stunning Job ! Gratz !

BTW ... Nominated !

Ty

Mooff 07-27-2011 09:31 AM

Update on Attachements:

I tried debugging it today, but unfortunately run into a huge bug our CMS has. It does not show attached images at all. Neither preview, nor inline, nor in the attachement box. Pictures which are working fine in the forum. Instead it sends our server into some kind of loop, until it ends up with a 503 minutes later...

Without working CMS attachements i can't test the slider code for it.

Doing some searching in the jira vbulletin bugtracker it does look like this might be fixed in 4.1.4 / 4.1.5 - so i'll look into it again once we have updated our forum to that version.

Meanwhile the slider is now running fine on our main cms page and i'll include the jpg/png and charakter encoding stuff soon.

Alfa1 07-27-2011 05:22 PM

Unless you are 100% sure that the same issue already exists in JIRA, please add a new JIRA report, so that we are sure that the issue is in JIRA.

Mooff 07-27-2011 06:09 PM

Seems to be that issue:
http://tracker.vbulletin.com/browse/VBIV-5661
( has been there since vb4.0.2 :/ )

Mooff 07-27-2011 10:06 PM

Osbes managed to sort that attachment bug out on our site.

-> new version added

0.9.9 (28.07.2011)
  • images are now saved as jpg instead of png -> reduced filesize by a factor 10
  • removed a bug causing weird characters to show up in the previewtext
  • added loads of debug messages and a debug mode
  • removed beta status - slider is running on our live site now


Attachments are working fine for us now. Important point: Guests need to be able to see them, if they can't neither can the slider.

Reworked the FAQ.


Next version will be uploaded once we've upgraded our board to 4.1.5 (given the upgrade calls for slider changes).

Aramist 07-27-2011 10:40 PM

Nice ! :D

Crotan 07-28-2011 02:09 AM

No go for me, appears to be grabbing articles fine but it displays them all at once and with no images.

https://vborg.vbsupport.ru/external/2011/07/8.png

Mooff 07-28-2011 07:30 AM

Please go through the FAQ in the first comment.

It looks like the path in the php-code isn't set to where you did upload the files. Or it might be a jquery problem.

starman? 07-28-2011 03:45 PM

PHP Code:

 <script type="text/javascript" src="clientscript/jquery/jquery-1.4.4.min.js"></script

Did you see this? It's the wrong version and isn't pointing to the folder where nivo is.

Mooff 07-28-2011 03:54 PM

It's pointing to a vbulletin jquery file in the clientscript folder. I'm going to change that in the next version though, since vbulletin does replace the file with an up to date jquery file in 4.1.5.

Alfa1 07-29-2011 12:36 AM

Are the instructions in the 1st post up to date now?

Mooff 07-29-2011 07:09 AM

Yes and in the first comment is a faq which should be read if something doesn't work.

Gemma 07-29-2011 10:26 AM

Thanks for the updates, great work and support :)

Aramist 07-30-2011 07:11 AM

Hi Mooff !

When i set an article to be published in a future day, slider show this article (cause i set published = yes)..

It should avoid "not really published yet" articles.

I didn't figured out how to solve this.

Any clue?

ty in advance

Mooff 07-30-2011 07:51 AM

Thanks for mentioning it, totally forgot about that cms feature since we don't use it. :D
Will fix it in the next version. Until then (untested):

old:
Code:

        WHERE
            node.setpublish = 1 AND
            node.publishdate > '%d' -34560000
        GROUP BY node.nodeid
        ORDER BY node.publishdate
        DESC LIMIT 20"
        ,$article_type,$time);

new:
Code:

        WHERE
            node.setpublish = 1 AND
            node.publishdate > '%d' -34560000 AND
            node.publishdate < '%d'
        GROUP BY node.nodeid
        ORDER BY node.publishdate
        DESC LIMIT 20"
        ,$article_type,$time,$time);


Aramist 07-30-2011 06:10 PM

Works Fine !!

Ty again Dude !

Cya

The Rocketeer 07-31-2011 02:52 PM

great work on the slider Moof. thank you very much. I have been following the topic since my original post back at the slider request fund gathering topic.

anyhow, i had some questions and suggestions.

1. Are we able to select which articles to display on the slider? maybe have an option in the acp or somewhere so we can just enter the article numbers / ids / urls and it will go get them?

2. Also maybe you could try to enhance it a bit? make it faster and lite so it doesn't end up slowing down our forums(not that it does that but just a suggestion.)

3. Lets say the first image is a verticle rectangle instead of the horizontal one. lets say my articles first image is 200px wide and 500px high but my second image is ideal, 600px wide x 400px high. Can we program it to fetch the second image instead(if the first one is too small and if a second one exists and is bigger / proper size?)

these are some of the many things i wanted to ask and suggest, i hope you'd have a look through them all. :)

Mooff 07-31-2011 03:30 PM

thanks


1.
Yes, that is possible. Actually this is kinda running on our board. We are using a hybrid system where a) a maximum of 2 articles per section are added into the slider b) tournaments (from our self coded tournament system) gain a value-bonus c) an extra query in a special database checks whether the article should be in there definitely or not at all d) articles are not allowed to be older than 40 days. All points are interconnected via the value function and it probably will be extended if the vbseo like system we activated today is used sensible by our users.

What a board needs there is highly dependend on the board itself. So i won't add something like this as default behaviour. In addition if you just want 'those' articles and nothing else the database query can be optimized for that need.

Long story short, as said in the first topic. If someone wants a customized query i need to know what exactly they want and i can try to come up with some code for it. No promises though. =) (these special queries will then be linked in the FAQ in post two, a category based one is allready in there, so as a work around you could use that one and add the articles you need in there, or remove them when the time comes for that).


2. The slider is blazing IF it can load all data out of the cms cache system - and i can't speed that one up*. Running the database query and saving pictures and rebuilding the output is not that fast. But, that does not have to be done often. Considering point 1, you want only articles in there which you specify in the code, you don't need it to update at all. So set the cache time for the slider to over 9000 (well or more). And rebuild it (clear cms cache) every time you change the article ids.


3. As for preview pictures. I won't comment on that one until i know what vbulletin changed in 4.1.5 (jira said they are doing something to preview pictures).


*well not in this addon anyway ;)

The Rocketeer 08-01-2011 05:35 AM

Quote:

Originally Posted by Mooff (Post 2227270)
thanks


1.
Yes, that is possible. Actually this is kinda running on our board. We are using a hybrid system where a) a maximum of 2 articles per section are added into the slider b) tournaments (from our self coded tournament system) gain a value-bonus c) an extra query in a special database checks whether the article should be in there definitely or not at all d) articles are not allowed to be older than 40 days. All points are interconnected via the value function and it probably will be extended if the vbseo like system we activated today is used sensible by our users.

What a board needs there is highly dependend on the board itself. So i won't add something like this as default behaviour. In addition if you just want 'those' articles and nothing else the database query can be optimized for that need.

Long story short, as said in the first topic. If someone wants a customized query i need to know what exactly they want and i can try to come up with some code for it. No promises though. =) (these special queries will then be linked in the FAQ in post two, a category based one is allready in there, so as a work around you could use that one and add the articles you need in there, or remove them when the time comes for that).


2. The slider is blazing IF it can load all data out of the cms cache system - and i can't speed that one up*. Running the database query and saving pictures and rebuilding the output is not that fast. But, that does not have to be done often. Considering point 1, you want only articles in there which you specify in the code, you don't need it to update at all. So set the cache time for the slider to over 9000 (well or more). And rebuild it (clear cms cache) every time you change the article ids.


3. As for preview pictures. I won't comment on that one until i know what vbulletin changed in 4.1.5 (jira said they are doing something to preview pictures).


*well not in this addon anyway ;)


Thanks Mooff,


1. So yes, as for the customized query, What I am wanting is not a category based one but maybe an option with a YEs / No and a box somewhere in the Admin CP so we can login and click that option, set it to yes(?) and enter article ID's numbers with commas (,) eg, 178,162,78 and it will only show those articles.

2. Yes, exactly, I want to spesify the articles that should be displayed on the slider, so I dont need it to automatically update anything as I will probably do it myself once every couple of weeks depending on which article I want to feature. So some instructions on that would be great, as we can probably cut down some database querys etc.

3. No proiblem we will see that later on,

But at the moment the first and second feature is what I and a lot of others could really use to define what articles we want to display manually. Hope you can look into it and post some instructions on your second post / F.A.Q for us. Really looking forward to this, so please let me know or if I sounded a bit confusing. :D

Thanks again and do let me know :)

The Rocketeer 08-02-2011 12:51 AM

I'm getting this error Mooff :(

Code:

// DEBUG MODUS ! $debug_modus = false; if($debug_modus === false)  '

Mooff 08-02-2011 06:37 AM

On first glance it looks like you are using the wrong widget type. Html static instead of php execute.

Please check (or create a new widget) from type php execution and insert the code again.

The Rocketeer 08-02-2011 10:26 AM

Thanks, Looks like I missed that one. Seems to be okay now, But its using the fallback image, its not pulling images from the articles? something I missed ? (Sorry, but I cant seem to get much help from the FAQ I am afraid.) :(

Mooff 08-02-2011 10:50 AM

Last question. :P

Q: My question wasn't answered in this FAQ
A: Please set the slider into debug mode via $debug_modus = true;
You then should see debug messages, which might point you in the right direction.
If that doesn't help. Post in the thread and please provide above debug and very detailed information what doesn't work and what you want.


Debug will help me a great deal finding out what's amiss. :D


As for the specific articles. I will rewrite the query to account for that, basecially i know what to do, but i can't type that out of my head and give it to you untested. Should find some time during the next days for that.

The Rocketeer 08-02-2011 10:59 AM

Hahaha lol :D

looks like I missed that one too, :p here is the debug code I got..

Code:

DEBUG MODE is ON!
slider_img_filepath: public_html/frontpage_nivo_slider/
width: 650 height: 250
show_articles_without_image:
fallback_img: public_html/frontpage_nivo_slider/uf_fallback_slider.png
#img: 5
description_length: 95

Warning: imagejpeg() [function.imagejpeg]: Unable to open '[path]/public_html/frontpage_nivo_slider/slide_0.jpg' for writing: No such file or directory in [path]/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 165


Mooff 08-02-2011 11:13 AM

The folder public_html/frontpage_nivo_slider/ is not writeable for the user/group your webserver is in.

chmod777 that directory and it should work.


All times are GMT. The time now is 12:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01562 seconds
  • Memory Usage 1,893KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (16)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete