Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
March 20, 2010, 10:40:27 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
WB 2.8.1 veröffentlicht!
Download und weitere Informationen gibt es
hier
.
110556
Posts in
15966
Topics by
9310
Members
Latest Member:
stevenris10
WebsiteBaker Community Forum
English
Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
(Moderators:
Argos
,
BerndJM
)
Code Snippet: Display news items, anywhere
Pages:
1
...
11
12
[
13
]
14
15
...
19
Author
Topic: Code Snippet: Display news items, anywhere (Read 65525 times)
mylesk42
Offline
Posts: 56
Anynews and DHTML
«
Reply #300 on:
June 02, 2009, 11:34:05 AM »
Hi everybody,
Has anyone tried to have a News scroller in DHTML to show news via the AnyNews module and to keep the linking to the news itself ?
Regards
Logged
doc
Offline
Posts: 3581
Re: Anynews and DHTML
«
Reply #301 on:
June 02, 2009, 05:47:14 PM »
Hi,
first of all, please try to raise your question in the correct module thread. The
module thread
for discussion are normally linked on AMASP or the
Website Baker Addons repository
.
Now to your question. Have you checked out the Coda Slider stuff integrated since Anynews v1.00? This should give you a good starting point for Javascript driven News output. If you have already a working JS script, maybe post the link so other users may be able to pick it up and to create a working demo.
Regards Christian
Maybe a forum administrator can move this thread into the Anynews thread.
Logged
kweitzel
Forum administrator
Offline
Posts: 5561
Re: Code Snippet: Display news items, anywhere
«
Reply #302 on:
June 02, 2009, 06:09:26 PM »
OK ... done.
cheers
Klaus
Logged
http://www.weitzel.biz
PM has been disabled
Boudi
Offline
Posts: 501
//o_-\\
Re: Code Snippet: Display news items, anywhere
«
Reply #303 on:
June 03, 2009, 07:53:07 PM »
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
Code:
array(3,4)
thing only publics certain groups, not certain languages.
Any help would be appreciated.
Greetz,
Boudi
Logged
...:: Bake the Unbakable ::...
doc
Offline
Posts: 3581
Re: Code Snippet: Display news items, anywhere
«
Reply #304 on:
June 03, 2009, 08:30:39 PM »
Hello Boudi,
same problem was reported in the German forum part today
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:
Code:
<?php
if (
function_exists
(
'displayNewsItems'
)) {
if (
LANGUAGE
==
'DE'
) {
displayNewsItems
(
2
,
3
,-
1
,
1
,
'de'
,
true
,
'<p><a><img>'
,
'none'
,
4
,
3
,
'disabled'
);
} else {
displayNewsItems
(
3
,
3
,-
1
,
1
,
'en'
,
true
,
'<p><a><img>'
,
'none'
,
4
,
3
,
'disabled'
);
}
}
?>
Regards Christian
Logged
Boudi
Offline
Posts: 501
//o_-\\
Re: Code Snippet: Display news items, anywhere
«
Reply #305 on:
June 03, 2009, 08:37:47 PM »
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?
Logged
...:: Bake the Unbakable ::...
doc
Offline
Posts: 3581
Re: Code Snippet: Display news items, anywhere
«
Reply #306 on:
June 03, 2009, 09:13:22 PM »
Hi Boudi,
Quote from: boudi
But 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
Logged
Boudi
Offline
Posts: 501
//o_-\\
Re: Code Snippet: Display news items, anywhere
«
Reply #307 on:
June 03, 2009, 09:26:08 PM »
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
Thnq anyway for your help.
Greetz,
Boudi
«
Last Edit: June 03, 2009, 10:19:28 PM by Boudi
»
Logged
...:: Bake the Unbakable ::...
Boudi
Offline
Posts: 501
//o_-\\
Re: Code Snippet: Display news items, anywhere
«
Reply #308 on:
June 03, 2009, 10:23:05 PM »
It seems working now. (with the Page Language disabled
) 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)
Code:
<?php
if (
function_exists
(
'displayNewsItems'
)) {
if (
LANGUAGE
==
'DE'
) {
displayNewsItems
(
2
,
3
,-
1
,
1
,
'de'
,
true
,
'<p><a><img>'
,
'none'
,
4
,
3
,
'disabled'
);
} else {
displayNewsItems
(
3
,
3
,-
1
,
1
,
'en'
,
true
,
'<p><a><img>'
,
'none'
,
4
,
3
,
'disabled'
);
}
}
?>
«
Last Edit: June 03, 2009, 10:25:27 PM by Boudi
»
Logged
...:: Bake the Unbakable ::...
doc
Offline
Posts: 3581
Re: Code Snippet: Display news items, anywhere
«
Reply #309 on:
June 03, 2009, 10:33:17 PM »
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.
Code:
<?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
Logged
Boudi
Offline
Posts: 501
//o_-\\
Re: Code Snippet: Display news items, anywhere
«
Reply #310 on:
June 03, 2009, 10:43:02 PM »
Christian,
Your code just did the job. Thnq very much!
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.
Logged
...:: Bake the Unbakable ::...
doc
Offline
Posts: 3581
Code Snippet: Anynews
«
Reply #311 on:
June 07, 2009, 09:11:03 PM »
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 Website Baker Addons Repository.
Regards Christian (doc)
Logged
snooze
Offline
Posts: 11
Re: Code Snippet: Display news items, anywhere
«
Reply #312 on:
July 08, 2009, 01:10:11 AM »
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.
Logged
D72
Offline
Posts: 89
Re: Code Snippet: Display news items, anywhere
«
Reply #313 on:
July 08, 2009, 01:14:16 AM »
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.
cheers
gr
Dave
Logged
erpe
Offline
Posts: 1738
Re: Code Snippet: Display news items, anywhere
«
Reply #314 on:
July 17, 2009, 11:47:44 AM »
Quote
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.
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
Logged
Search on
All Modules And Snippets Project (AMASP)
Be part of the
Tutorials-Project
WebBird
Offline
Posts: 1714
Re: Code Snippet: Display news items, anywhere
«
Reply #315 on:
July 17, 2009, 12:10:34 PM »
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.
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.
Logged
I wanna go back to find the innocent days that I left behind... I still believe they're holding ground... behind the battle lines... (John Wetton)
erpe
Offline
Posts: 1738
Re: Code Snippet: Display news items, anywhere
«
Reply #316 on:
July 17, 2009, 12:25:04 PM »
Hi WebBird
nice to hear that you will care about this snippet.
Thanks
erpe
Logged
Search on
All Modules And Snippets Project (AMASP)
Be part of the
Tutorials-Project
WebBird
Offline
Posts: 1714
Re: Code Snippet: Display news items, anywhere
«
Reply #317 on:
July 17, 2009, 12:25:17 PM »
Quote from: erpe on July 17, 2009, 11:47:44 AM
Anyone with an idea?
Yes.
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.
Logged
I wanna go back to find the innocent days that I left behind... I still believe they're holding ground... behind the battle lines... (John Wetton)
WebBird
Offline
Posts: 1714
Re: Code Snippet: Display news items, anywhere
«
Reply #318 on:
July 17, 2009, 12:26:15 PM »
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.
Logged
I wanna go back to find the innocent days that I left behind... I still believe they're holding ground... behind the battle lines... (John Wetton)
Stefek
Backend Theme Team
Offline
Posts: 3202
Re: Code Snippet: Display news items, anywhere
«
Reply #319 on:
July 17, 2009, 12:28:49 PM »
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
Logged
Bowling in
Kiel
Halle
Aschaffenburg
"Es gibt viele Pfade am Fuße des Berges,
doch von der Spitze aus, erblicken wir alle den selben Mond."
jap. Sprichwort
WebBird
Offline
Posts: 1714
Re: Code Snippet: Display news items, anywhere
«
Reply #320 on:
July 17, 2009, 12:32:26 PM »
Quote from: Stefek on July 17, 2009, 12:28:49 PM
//EDIT, Bianka was faster
But your explanation was helpful.
Logged
I wanna go back to find the innocent days that I left behind... I still believe they're holding ground... behind the battle lines... (John Wetton)
erpe
Offline
Posts: 1738
Re: Code Snippet: Display news items, anywhere
«
Reply #321 on:
July 17, 2009, 12:45:16 PM »
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.
Logged
Search on
All Modules And Snippets Project (AMASP)
Be part of the
Tutorials-Project
WebBird
Offline
Posts: 1714
Re: Code Snippet: Display news items, anywhere
«
Reply #322 on:
July 17, 2009, 12:48:31 PM »
I think it would be nicer if the break would not be in the middle of a word.
So this will not happen again. Should be fixed.
Logged
I wanna go back to find the innocent days that I left behind... I still believe they're holding ground... behind the battle lines... (John Wetton)
WebBird
Offline
Posts: 1714
Re: Code Snippet: Display news items, anywhere
«
Reply #323 on:
July 17, 2009, 12:50:50 PM »
My English is perfect, isn't it*
Logged
I wanna go back to find the innocent days that I left behind... I still believe they're holding ground... behind the battle lines... (John Wetton)
doc
Offline
Posts: 3581
Re: Code Snippet: Display news items, anywhere
«
Reply #324 on:
July 17, 2009, 12:52:17 PM »
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
Logged
Pages:
1
...
11
12
[
13
]
14
15
...
19
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
Loading...