Snippet: cwsoft-anynews

cwsoft

#27
@mdemaree99

Thanks for the exhaustive details.

Quote from: mdemaree99I put the PHP info in the test area as well.  I was able to get the php version, but wow it is running slow.
My browser required 15 seconds to display the PHP info (which you never should t make public by the way) from your website. On my website it takes about 560 micro seconds to display the PHP info, which is a factor of 26. So yes, there is something wrong on your site.

According the Firebug Network protocoll, your main page (the one with the biggest lag) has a lot of HTTP request (43) and needs about 14 seconds to load all files. Your main site needs 8s until the DOM is ready, which is the trigger to fire up the jQuery stuff. So before the jQuery slider starts working, it takes at least 8s time to load all the content of your main site. To load all Javascript and CSS files takes about 6s.

The "better-coda-slider" consumes 7 HTTP requests (5 to load the original JS and CSS files) and another two for the customized JS and CSS. In total the "better-coda-slider" consumes around 4.4 seconds loading time. Flexslider needs less requests and resources. As the "better-coda-slider" tries to be unobstrusive, it displays the slider icons (left, right arrows) only if Javascript is enabled AND the DOM is ready. This could be used as a sort of visual measure for load optimization.

I doubt that Anynews is the real issue maker here. I would contact your webhosting company and ask for advice. The long loading time until the PHP infos are displayed and the 8s to get the DOM ready seems quite long. If you want to have a sort of protocoll with elements, requests, file size and loading time, you can use other online services as well, such as http://analyze.websiteoptimization.com

Sorry, think I can't really help you on that issue.

Cheers

mdemaree99

I tested like you did and just put the slider on a page by itself.
Along with testing 3 other templates I still get a lag.  However I am noticing I may have some errors in my templates.  They are working fine in the actual website, but when I created the testing area  things aren't quite loading up correctly for some reason.  (code sections are looking funny)  Fine on rest of my pages.  Not sure what is up.


Testing site:
Main page is www.jlarlington.org/jlabaker and has the biggest lag.
Tons of stuff on this page so I can see why it takes a big, but nothing else seems to load up slow.
I made a few test pages for Anynews here:
http://www.jlarlington.org/jlabaker/pages/testing/anynews-testing.php

Test pages aren't to bad, but just the module by itself.
Test 1 is the fastest with the CSS
Templates do have the testing to see if something contains data. 
I believe that has given a few modules problems..

<?php
        ob_start
();
        
show_menu2(0SM2_CURR+1SM2_CURR+1);
        
$childmenu ob_get_contents();
        
ob_end_clean();
?>



Test 2 and 3 are about the same.
I put the PHP info in the test area as well.  I was able to get the php version, but wow it is running slow.
Not quite sure why it is taking forever to load. 

For the time being I put a small work around in.  I changed overflow to hidden in the better-coda-slider.css
By updating the   .scroll  thescroll-bar so it just appears 1st slide is active longer than the rest and then the arrows appear.  Just need to tweak for final output.

.scroll {
   height: 150px;
   width: 450px;
   overflow: hidden;
   overflow-x: hidden;
   position: relative;
   clear: left;
   background: #FFF url(images/content_gradient.gif) repeat-x scroll left bottom;



Detailed error description (what happens, what have you tried ...)
- lag..of 2-5 sec before slider is active

Anynews version (go to WebsiteBaker section Add-ons / Info / Anynews)
Anynews 2.2.0-RC2


PHP version

PHP Version 5.2.11

System    
Windows NT IIS01801 5.2 build 3790    
Know the windows server is a big killer for me..

WebsiteBaker version
Revision 1528
Admin version 1.6

WebsiteBaker frontent template
- Custom templates - Initial glassbury and simplecss.

Changes you made to WebsiteBaker
- No changes to WebsiteBaker, but had to make a minor change to library-admin due to the windows server.

Browsers:
Firefox 3.6.24 and Internet explorer 8 and 9


Thanks for the info on firebug.  I was searching the web for online items to speed it see where the bottleneck was.  Always good when the solution is free.l

cwsoft

#25
Hi,

could you please provide the infos listed at the bottom of the cwsoft-anynews README file? In addition please provide details on your browser, browser version. A link to a live side would be helpfull if available.

Tested cwsoft-anynews with Firefox 10.2 with better-coda-slider and flexslider at one page. Both news show up immediatelly and react independant of each other without issues. If you are using more than one slider effect per page, try to reduce it to one sliding effect per page and check if that solves your issue. Don't know if files included via jQuery $.insert plugin are cached, as done with files included e.g. via link statements in the head section of a HTML file. If you still experience issues, try to check the loading / request time with browser tools like Firebug to identify the bottle neck.

QuoteGreat notes and love the idea of separating the custom js from the 3rd party js.  However...The custom aspects of the coda slider are located in 3rd party folder.
Thanks. Unfortunatelly, the old "better-coda-slider" is not build as jQuey plugin and not maintained by the developer anymore. If someone wants to create a plugin from the files included, please do so. Will than update my files accordingly. I keept the "better-coda-slider" mainly for backwards compatibility, but would recommend to switch to flexslider instead. As alternative you may want to implement another jQuery plugin, which should be fairly simple with the updated cwsoft-anynews version :wink:

Cheers

[gelöscht durch Administrator]

mdemaree99

Is anybody else is having issues with the new module using the sliders?

In both the coda and flex sliders I get about a 5 second delay / lag before the slider starts working.
Had similar issues in previous version with coda, but it wasn't as bad (maybe 1-2 sec)

I have included the screen shots.  Top is initial image that is shown for about 5 sec on coda and a little longer in flexslider.  It may be the same time, but seems longer with nothing showing on the screen.

After a little testing..I thought this may be tied to the interval or duration, but changing values just seemed to shorten or lengthen after the slider actually appeared.  Still had about a 5 sec delay.  Are these scripts really this slow?  Possible compress to run faster?  Any other values I may be missing?

On a side note..I was was looking at the js files.  Great notes and love the idea of separating the custom js from the 3rd party js.  However...The custom aspects of the coda slider are located in 3rd party folder.
Would suggest separating a few of the settings to the custom js file.



 




[gelöscht durch Administrator]

cwsoft

#23
Thanks Argos, highly appreciated.

Argos

Here's the Dutch language file:


<?php
/**
 * Code snippet: anynews
 *
 * This code snippets grabs news from the WB news module database
 * and displays them on any page you want by invoking the function
 * displayNewsItems() via a page of type code or the index.php 
 * file of the template.
 *
 * This file contains the Dutch language output.
 * 
 * LICENSE: GNU General Public License 3.0
 * 
 * @platform    CMS WebsiteBaker 2.8.x
 * @package     anynews
 * @author      cwsoft (http://cwsoft.de)
 * @translation forum member Dave (ak D72), Argos
 * @version     2.2.0
 * @copyright   cwsoft
 * @license     http://www.gnu.org/licenses/gpl-3.0.html
*/

// Dutch module description
$module_description 'Snippet om nieuwsberichten te tonen op elke pagina die u maar wilt. Functie kan opgeroepen worden vanuit de template of een code-sectie. Meer informatie is te vinden op <a href="https://github.com/cwsoft/wb-anynews" target="_blank">GitHub</a>.';

// initialize global $LANG variable as array if needed
if (! isset($LANG) || (isset($LANG) && ! is_array($LANG))) {
$LANG = array();
}

$LANG['ANYNEWS'][0] = array(
// text outputs for the frontend
'TXT_HEADER' => 'Laatste nieuws'
'TXT_READMORE' => 'Lees meer'
'TXT_NO_NEWS' => 'Geen nieuws beschikbaar.',
'TXT_NEWS' => 'Nieuws'
'TXT_NUMBER_OF_COMMENTS' => 'Aantal reakties'

// date/time format: (9:12 PM, 31-12-2012)
'DATE_FORMAT' => ' (d-m-Y, H:M)'
);
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

cwsoft

#21
@argos: thanks for your offer, looking forward to implement the updated NL files

Argos

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

cwsoft

#19
Hi,

forgot to mention that I do need some help in updating some cwsoft-anynews text outputs into the following languages: Estonian (EE.php), French (FR.php), Dutch (NL.php), Serbian (RS.php) for Anynews 2.2.0 stable.

English phrases which needs to be translated into languages above:
a) "For details please visit " GitHub. (GitHub needs no translation)
b) "Number of comments"

Would be great if a native speaker could review the cwsoft-anynews language files listed above for possible misspelling or grammar issues. You can post your translation/updates in this thread or send me a PM.

Thanks in advance
cwsoft

Argos

Looks very nice. Great to see the section-ID, page-ID and post-ID support added!
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

cwsoft

#17
Hello,

issued a first release candidate (RC1) of the upcoming cwsoft-anynews v2.2.0 at GitHub.

This version includes three improvements and additional features requested by forum users:
1. the hardcoded "no news available" text can now be styled or removed via Anynews template files
2. the flag $lang_filter allows to remove news entries not matching the defined $lang_id
3. values of group_id can now be linked to group_id, page_id, section_id or post_id

Apart from that a bug in the language file inclusion of v2.1.0 was fixed.

The cwsoft-anynews v2.2.0 function signature has changed as follows:
The last two parameter are new and where added to the end of the function to not break older Anynews function calls. Paramter $group_id_type defaults to "group_id", paramter $lang_filter to false, which is the default behaviour of previous Anynews versions.


<?php
function displayNewsItems(
  
$group_id 0,                  // IDs of news to show, matching defined $group_id_type (default:=0, all news, 0..N, or array(2,4,5,N) to limit news to IDs matching $group_id_type)
  
$max_news_items 10,           // maximal number of news shown (default:= 10, min:=1, max:= 999)
  
$max_news_length = -1,          // maximal length of the short news text shown (default:=-1 => full news length)
  
$display_mode 1,              // 1:=details (default); 2:=list; 3:=coda-slider; 4:flexslider; 4-98 (custom template: display_mode_X.htt); 99:=cheat sheet
  
$lang_id 'AUTO',              // language file to load and lang_id used if $lang_filer = true (default:= auto, examples: AUTO, DE, EN)
  
$strip_tags true,             // true:=remove tags from short and long text (default:=true); false:=don´t strip tags
  
$allowed_tags '<p><a><img>',  // tags not striped off (default:='<p><a><img>')
  
$custom_placeholder false,    // false:= none (default), array('MY_VAR_1' => '%TAG%#', ... 'MY_VAR_N' => '#regex_N#' ...)
  
$sort_by 1,                   // 1:=position (default), 2:=posted_when, 3:=published_when (only WB 2.7), 4:= random order, 5:=number of comments
  
$sort_order 1,                // 1:=descending (default), 2:=ascending
  
$not_older_than 0,            // 0:=disabled (default), 0-999 (only show news `published_when` date <=x days; 12 hours:=0.5)
  
$group_id_type 'group_id',    // type used by group_id to extract news entries (supported: 'group_id', 'page_id', 'section_id', 'post_id')
  
$lang_filter false            // flag to enable language filter (default:= false, show only news from a news page, which language fits $lang_id)
);


Setting $lang_filter = true shows only news items added from a news page which LANGUAGE type matches $lang_id. If no news page exist for this LANGUAGE, all news entries will be shown instead.

Feedback welcome.

Cheers

Argos

Nice to see someone actively maintaining this often used snippet. Thanks for your efforts.

It would be nice to see offical section support added to it, besides groups support. There is a hack somewhere on the forums that shows how to use AnyNews with section ID, but that never made it into the official module. I believe few people use groups in News, most people would just use separate sections to show News about different subjects.
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

cwsoft

#15
Hi,

just released cwsoft-anynews V2.1.0 STABLE at GitHub. The latest version requires WebsiteBaker 2.8.2 (recommended last stable 2.8.x version) und PHP 5.2.2 (recommended last stable 5.3.x version).

Changes compared to cwsoft-anynews v2.0.0
Third party code was moved into a separate subfolder. Integration of custom Javascript or jQuery plugins was simplified. The additional jQuery slider effect plugin "flexslider" was added as alternative to the outdated "better-coda-slider" distributed with Anynews.

Location and naming of template files have changed from /htt/custom_display_mode_X.htt to /templates/display_mode_X.htt. The Anynews cheat sheet template providing an overview of all Anynews template placeholders is now displayed via $display_mode = 99 (before $display_mode = 4). The HTML output of the Anynews template files is now wrapped in a div with class mod_anynews to avoid clashes with other modules, templates or WebsiteBaker CSS definitions.

Links
README

Cheers cwsoft

cwsoft

#14
Hello,

thanks for your feedback so far, see my comments below.

Quote from: mdemaree99Flexslider looks good as long as it works with Anynews.  I only see it working with images.
As flexslider is already implemented in Anynews 2.1.0 ALPHA, it should work (display_mode = 4).

Quote from: mdemaree99Already a fan of codaslider...
Guess you are talking about coda-slider-2.0 - right?
Only issue I have with this plugin is that it seems not actively maintained (last update from Oct. 2009).

Quote from: mdemaree99Couldn't get the link to innerfade work.
The link posted below works for me. Maybe do a Google search for "innerfade jQuery".

Quote from: dbsOld and good are also cycle-plugin
Thanks for the link, will have a look on this plugin.

Quote from: dbsAnother is jcarousellite
As this Plugin is not actively maintained (last update 2007) I doubt it will make it into cwsoft-anynews.

Cheers

dbs

Old and good are also cycle-plugin http://jquery.malsup.com/cycle/.
I use it for Anynews.

Another is jcarousellite http://www.gmarwaha.com/blog/2007/08/09/jcarousel-lite-a-jquery-plugin/
Used as Bakery-Item-Slider.

Both works with jquery 1.7.1, supports pause on mouseover, endless scroll and more.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

mdemaree99

Flexslider looks good as long as it works with Anynews.  I only see it working with images.
Already a fan of codaslider...
Couldn't get the link to innerfade work.

Another simple jq option is  http://bxslider.com/
Not sure on the last time it was updated though.

cwsoft

Hello,

I want to update the jQuery sliding/fading effect for the upcoming cwsoft-anynews version 2.1.0.

So far anynews ships with a jQuery effect called better-coda-slider, which is a free rebuild of the commercial Panic - Coda slider. As the "better-coda-slider" has a lot of dependencies to other jQuery plugins and is no longer actively developed, I decided to drop it in favour of another jQuery plugin.

So far I have reviewed the following candidates:
- flexslider (my favorite so far, Open Source, last update Oct. 2011)
- coda-slider-2.0 (GPL, but last update 2009)
- innerfade (simple plugin, but last update from 2008)

Before I pick one jQuery slider plugin, I would like to ask YOU, if YOU:
- know a better slider which is actively maintained, licensed under GNU (or equivalent), works with jQuery 1.7
- want to share your expertise in styling the slider to look good in Anynews (e.g. buttons, boxes, ...)

If you want to suggest another slider which fulfills above requirements and/or want to add your hands on the final CSS layout for the slider shipped with the upcoming cwsoft-anynews (credits will be given), please post in this thread or send me a PM.

Deadline for your suggestions and/or help offers is 26th Feb. 2012 (one week from now). After that date I will carry on with the development of cwsoft-anynews v2.1.0.

Cheers

P.S.: To get an impression of how jQuery effects will be integrated into Anynews 2.1.0, you may want to download and test the first ALPHA version announced in post 7 of this thread. The ALPHA version includes all slider effects except the innerfade slider mentioned above.

cwsoft

#10
Well I know, but as all templates shipped with WB 2.8.2 und 2.8.3 still include this, I decided to copy it over.
Its easier for me to explain to search for that code in the template and refer to Default templates, than trying to teach the right way off doing it :-)

Cheers

DarkViper

a little hint:
if (function_exists('register_frontend_modfiles')) {
is never needed since 2.8.1. The funktion is included in the core now and always available for templates.  8-)
[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

cwsoft

#8
Hi,

uploaded a first ALPHA version of the upcoming cwsoft-anynews version 2.1.0 on GitHub

The version is written for the WB 2.8.x series only, starting from WB 2.8.2 and intended to be tested by more experienced users at a first place. The version is NOT YET ready for productive sites.

Apart from code restructuring, the handling of Javascript files was modified to make use of the mechanismns introduced with WebsiteBaker 2.8.1/2.8.2. In addition two new jQuery sliding effects were added: "coda-slida-2.0" and "flexslider" (set display_mode = 3,4 or 5).

To make the jQuery slida effect working, one needs to add the following code into the head section of the index.php of the frontend template:


<?php
if (function_exists('register_frontend_modfiles')) {
register_frontend_modfiles('css');
register_frontend_modfiles('jquery');
register_frontend_modfiles('js');
?>



Note: CSS styling and parameters of the slida effects can be modified by the files located in folders css and javascript. The jQuery plugin files in the folder thirdparty should not be modified unless there is a real need for it.

Feedback welcome.

Cheers

mdemaree99

#7
I am using the Anynews with coda slider

The update will be great and should get rid of many of the compatibility issues with other modules.

Another nice to have as  long as the coda slider is working.
Can you change the input box to match up with the height  for the Short: description?
Allows users to know exactly how much room they have to work with when building a slide.

I originally modified my anynews for the height and ideally I would change width also, but this changes up the editor up a little to much for my taste.

I did have one issue.  After changing the height, it seems I get an error message(everything works correctly even with error to m knowledge) when I change the title of the slide.  Not sure if they are related, but only started getting message after I changed height of short description. 

[gelöscht durch Administrator]

jacobi22

i used coda-slider in my test-space - with jquery 1.71, no Problems


kweitzel

I personally do use AnyNews but without the coda slider. The second one mostly because I never got it working to my satisfaction  :roll:

Cheers

Klaus

cwsoft

#4
Hello,

cwsoft-anynews ships with the third Party JQUERY Plugin Coda-slider, which seems no longer be actively developed. The Last Update was 2009 and requires jQuery 1.3.1. WB 2.8.2 ships with jQuery 1.7, which is incompatible to 1.3.1.

The question is, how many people Out there are Using this anynews feature and how many of the People using this Feature have issues? Is there an alternative for Coda-slider, licensed under GPL and Running with JQuery 1.7+?

Are there any cracks Out there willing to Update the Coda slider jQuery stuff? The answers will help to figure Out if this Feature will be Removed with the next version or Not.

Cheers

cwsoft

#3
Hello,

plans for the next release are:
- remove jquery 1.3.1 version shipped with the module and use the WB version instead (WB 2.8.2 --> jQuery 1.7)
- check compatibility of jQuery plugins with jQuery 1.7
- check for alternative plugins supporting jQuery 1.7+
- remove jQuery support from Anynews if no alternative slider working with jQuery 1.7 is found

Cheers

P.S.:  Seems the jQuery coda-slider plugin is no longer actively maintained (last commit 2009, required jQuery 1.3.1). Due to massive API changes from jQuery 1.3 to 1.7, I doubt that the coda-slider plugin will work with jQuery 1.7 without massive changes. So if I do not find a compatible plugin, I tend to remove it from Anynews.