Code Snippet: Display news items, anywhere

WebBird

Quote from: doc on July 17, 2009, 12:52:17 PM
P.S.: Webbird nice to see that you will maintain the snippet in the future :-)

Well, it's easy to take care of a module I use myself. :wink: Thank you for this great snippet!

WebBird

Thanks, doc, for the hints. I will take care of it.

I just added a wordwrap2() function that hopefully will fix the text cut issue. :-D

doc

Hi,

similar issue is when usign the option to truncate the text output at a certain length but allow tags as already discussed in this thread or another thread dealing with Any News.

Another thing which could be fixed with a next version is to get rid of the jQuery stuff in the module folder (used for Anynews Coda Slider effect). Once WB 2.8 gets released, the jQuery stuff could be replaced with the WB 2.8 core jQuery routines.

Cheers Doc

P.S.: Webbird nice to see that you will maintain the snippet in the future :-)

WebBird


WebBird

I think it would be nicer if the break would not be in the middle of a word. :-D So this will not happen again. Should be fixed.

erpe0812

Sometimes it is so easy.
Thanks WebBird and Stefek.

That was it.

I changed the number of signs and was done.

rgds

erpe

PS: Is this something that has to be changed?  :?  If yes, let me know what you want to know.

WebBird


Stefek

Quote from: erpe on July 17, 2009, 11:47:44 AM
What is confusing me is that the same letter is shown right and wrong.

Seems to me that this is happening because the Snippet is cutting the Text after a predefined number of characters.
And it could be that the snippet stops counting by using the HTML Code, not its output in the Frontend.

So you have umlauts and you have 'ß'.
In HTML the Ä for example has - as you know - looks like Ä .
Let's consider the snippet is counting the characs in HTML so it will maybe count up to "&Aum" and then the Output is going nuts.

It's just what I can see through the picture.

Regards,
Stefek

//EDIT, Bianka was faster :-D
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

WebBird

Quote from: erpe on July 17, 2009, 12:25:04 PM
nice to hear that you will care about this snippet.

Well, it's in my own self-interest. :wink:

WebBird

Quote from: erpe on July 17, 2009, 11:47:44 AM
Anyone with an idea?

Yes. :-D

The news text is shortened. Shortening happens by counting the chars and cutting off the rest when the point of "max chars" is reached.

At this point, there is no single char, but a HTML Entity -> ß

This entity is not recognized, so the text is cut off anyway.

Please send me the complete text and the settings you're using. I will try to correct this issue.

erpe0812

Hi WebBird

nice to hear that you will care about this snippet.

Thanks

erpe

WebBird

Quote from: erpe on July 17, 2009, 11:47:44 AM
As Doc stopped maintaining this snippet I hope there is one who will further support this.

As I am using this snippet on a page I am going to update once 2.8 is released, I can take support for AnyNews. But please keep in mind that my own modules will have priority when I have to split my time. :roll: At the moment, the final release of EasyMenu has highest priority.

If there are open requests at this time (apart from the one erpe posted above), please let me know. I'll see what I can do.

erpe0812

Quoteplease note that I have suspended my support for the "Anynews" code snippet effective June 07, 2009. If someone wants to develop or maintain this code snippet any further, please feel free to do so, but keep in mind  that the module is licensed under GNU GPL.

As Doc stopped maintaining this snippet I hope there is one who will further support this.

Testing 2.8 RC1 I noticed some confusing things with German Language (see image).
I suppose that is has to do with the work that was done on the news module reffering to validation.
Maybe the anynews snippet has to be adapted. What is confusing me is that the same letter is shown right and wrong.
BTW in the news module/page itself  all signs are ok.

Anyone with an idea?

rgds

erpe

[gelöscht durch Administrator]

D72

Quote from: snooze on July 08, 2009, 01:10:11 AM
Why is there no New Topic button?

could be me... but this is a Topic with discussions and not a forum where you can find subjects like where we are right now. In topics it's not allowed to add a new topic. Or am i really in the need of some beauty sleep...
Getting to bed any way right now.  :mrgreen:

cheers

gr
Dave

snooze

Why is there no New Topic button?

That's not my actual question. This simple. Would someone please post step-by-step instructions to get Anynews working. I have the latest version installed on WB 2.7. I realize there are help files and web pages, but there seem to be steps left out and I can't bridge the gap.

I see that there's lots of options, but I want to see it working before getting fancy.

doc

Hello,

please note that I have suspended my support for the "Anynews" code snippet effective June 07, 2009. If someone wants to develop or maintain this code snippet any further, please feel free to do so, but keep in mind  that the module is licensed under GNU GPL.

The last stable version of the module can be found on the WebsiteBaker Addons Repository.

Regards Christian (doc)

Boudi

Christian,

Your code just did the job. Thnq very much!  :lol:

I got it working with the -> Settings -> Advanced Options -> Page Language disabled.

So no page language configuration is needed.

Again thnq!  :-)

Greetz,

Boudi

PS: If you would like to see this result then I would be happy to pm you.

...:: Bake the Unbakable ::...

doc

Hi Boudi,

guess you have a coding error and the error_reporting is set to E_NONE, thats why you see a blank screen.
You can do it via if, elseif, else statement, or to learn something different with a switch statement as shown below.

<?php
if (function_exists('displayNewsItems'))  {
  switch(
LANGUAGE) {
    case 
'DE':
        
displayNewsItems();
        break;
        
    case 
'EN':
        
displayNewsItems();
        break;
        
    default:
        
displayNewsItems();
        break;
    }

?>



Note:
Please check the Function parameter you pass over to Anynews. Arguments like 'none' and 'disabled' are no valid function parameters. Details can be found in the Anynews README file (section Example for a customized call).

Regards Christian

Boudi

#309
It seems working now. (with the Page Language disabled  :wink:) but still 1 problem: the website contains 3 languages:

Dutch/English/German

I used your example and tried to implement a 3rd language. But then I end up with a blank screen. But it actually does work with 2 languages.

How must I change this code into 3 languages? (Unfortunately I'm not a php coder so I can't 'see' how to achieve this)

<?php
if (function_exists('displayNewsItems'))  {
  if (
LANGUAGE == 'DE')  {
    
displayNewsItems(2,3,-1,1,'de',true'<p><a><img>','none',43,'disabled');
  } else {
        
displayNewsItems(3,3,-1,1,'en',true'<p><a><img>','none',43,'disabled'); 
  }

?>



...:: Bake the Unbakable ::...

Boudi

#308
Hi,

Well, again I ran into problems when enabling the Page Language and setting the news pages in their languages; they dissapear from the menu. (eg; the german button "aktuell" does not show up in the German menu)

Besides that your piece of coding didn't do anything. (didn't show the news at all)

I'm sure I'm doing something wrong over here but for the moment I'm still figuring out what exactly.

So I will brainstorm further this evening and tomorrow. When I get the job done I will let you know  :wink:

Thnq anyway for your help.

Greetz,

Boudi
...:: Bake the Unbakable ::...

doc

Hi Boudi,

Quote from: boudiBut is there still that issue with these setting? -> Settings -> Advanced Options -> Page Language.
Done some checks recently with the Language Switcher Snippet (flags), show_menu2 and the latest WB version (from SVN trunk) and have not run into any problems with the search yet.

Don´t now if this is fixed or not. Maybe it is best to start another thread to discuss about this issue, as this is not a "Anynews" specific tasks.

Good luck
Christian

Boudi

Hi Christian,

Thnx for your quick answer :)

But is there still that issue with these setting? -> Settings -> Advanced Options -> Page Language.

If you do so there will be problems when doing a search; the flags of other countries then will dissapear.

I thought I mentioned this behaviour for some months ago.

I just did a check on a multilanguage WB 2.7 website and enabled the Settings -> Advanced Options -> Page Language. After that I did a search and the flags dissapeared. After I turned this option off again the flags stayed intact after a search.

That's why I always turn this option off: Settings -> Advanced Options -> Page Language when creating multilanguage WB sites.

or am I doing seriously wrong over here?  :?

...:: Bake the Unbakable ::...

doc

Hello Boudi,

same problem was reported in the German forum part today  :wink:

You have to use the Page Language Feature of WB (Settings -> Advanced Options -> Page Language) and assign each page to e.g. German, English etc.

Than you can use the following construct (DE, EN Support) in your template index.php file to get things working:
<?php
if (function_exists('displayNewsItems'))  {
  if (
LANGUAGE == 'DE')  {
    
displayNewsItems(2,3,-1,1,'de',true'<p><a><img>','none',43,'disabled');
  } else {
        
displayNewsItems(3,3,-1,1,'en',true'<p><a><img>','none',43,'disabled'); 
  }

?>



Regards Christian

Boudi

Hi there,

Checked the help files and the forum but still didn't got the answer I was looking for.

Simple question:

Do I have to create a template for every language in which I want to place the news items for that specific language?

I have 3 languages, 3 different 'latest news' pages in each language. The automatic translation for the 'read more' button does work fine.

But do I have to create a template for every language because otherwise you see all the languages underneath each other in the latest news section.

May be I'm overlooking something because in the HELP files there is no mentioning about creating a template for every language in order to show only the specific language and not all languages underneath each other.

The array(3,4) thing only publics certain groups, not certain languages.

Any help would be appreciated.

Greetz,

Boudi
...:: Bake the Unbakable ::...

kweitzel