WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Code Snippet: Display news items, anywhere
  • Print
Pages: 1 ... 10 11 [12] 13 14 ... 21   Go Down

Author Topic: Code Snippet: Display news items, anywhere  (Read 373510 times)

doc

  • Guest
Code Snippet: Anynews
« Reply #275 on: April 14, 2009, 10:05:42 PM »
Hello,

just released v0.71 of the Anynews code snippet on the WebsiteBaker Add-ons repository.

The Readme file was updated accordingly and explains the parameters to use.

Modifications with respect to previous version:
 ~ moved language specific text outputs (e.g. read more, date/time format settings) to language files
 - removed parameters: $header_text, $readmore_text, $no_news_text, $date_time_format
 + removed support for outdated function call display_news_items()
 + use displayNewsItems() instead
 + added option to output news in random order ($sort_by = 4 as requested in the German forum)

Installation / Update:
Delete a previous version via the WB backend. Then install the latest version from the backend.

Remember to adapt your function parameters in code sections and/or the index.php file of your template!!!

Old parameter list:
Code: [Select]
<?php 
<?php displayNewsItems($group_id, $max_news_items, $max_news_length, $display_mode, 
  
$header_text, $readmore_text, $no_news_text, 
  
$strip_tags, $allowed_tags, $show_publish_date, $date_time_format,
  
$sort_by, $sort_order, $not_older_than); ?>

?>

New parameter list:
Code: [Select]
<?php 
displayNewsItems
($group_id, $max_news_items, $max_news_length, $display_mode, $lang_id,
  
$strip_tags, $allowed_tags, $show_publish_date,
  
$sort_by, $sort_order, $not_older_than); 
?>


If you use custom template files, check and replace the following placeholders:
Code: [Select]
{ARG_HEADER_TEXT} --> {TXT_HEADER}
{ARG_READMORE_TEXT} --> {TXT_READMORE}
{ARG_NO_NEWS_TEXT} --> {TXT_NO_NEWS}

Requirements:
 + Requires WebsiteBaker 2.7 or higher
 + the old function call display_news_items is no longer supported use displayNewsItems instead
 + check the parameter function

As usual, your feddback, suggestions etc. are welcome.

Regards Christian
« Last Edit: April 14, 2009, 11:34:37 PM by doc »
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #276 on: April 15, 2009, 09:18:26 PM »
Hello,

just released v0.80 of the Anynews code snippet on the WebsiteBaker Add-ons repository.

The Readme file was updated accordingly and explains the parameters to use.

Modifications with respect to previous version (v0.70 / v0.71):
 + $group_id supports multiple groups (default:= 0 all groups, X:= group X, for multiple groups: array(2,4,5) )
 + $lang_id = 'AUTO' first checks language in URL (e.g /EN/ --> domain.com/pages/en/page.php) than in LANGUAGE constant

Installation / Update:
Delete a previous version via the WB backend. Then install the latest version from the backend.

Note:
If you have want to upgrade from a version older than v0.70, you need to update your functions calls and templates as explained in this post.

Regards Christian
Logged

doc

  • Guest
Code Snippet: Anynews
« Reply #277 on: April 17, 2009, 09:09:33 PM »
Hello,

just released v0.92 of the Anynews code snippet on the WebsiteBaker Add-ons repository.
The Readme file is up to date.

Main changes:
 - removed legacy support for outdated WebsiteBaker versions 2.6.x and below (requires WB 2.7 or higher to work)
 - reworked the parameter sanity checks and moved routine into functions file
 - removed surrounding <p> tags from {CONTENT_SHORT} placeholder (added '<p>' to allowed tag list)
 - code clean up
 - replaced old function calls in file comment blocks with the new call (v0.91)
 - removed obsolete variables and debug information (v0.92)

The support of Anynews for WebsiteBaker versions 2.6.x or lower has expired with Anynews v0.90. Since Anynes v0.90 you need WebsiteBaker 2.7 or higher as minimum requirement for Anynews.

Installation / Update:
Delete any previous version via the WB backend. Then install the latest version.

Note:
If you want to upgrade from an Anynews version older than v0.70, you need to update your functions calls and templates as explained in this post.

Regards Christian
« Last Edit: April 19, 2009, 10:54:35 AM by doc »
Logged

abidan

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #278 on: April 25, 2009, 11:00:22 PM »
Hi

I am having trouble getting the array function to work with this module. This is what I am putting into my index file to show in my menu:
 <?php
             displayNewsItems(array(1,3,4,6,7,8,9), 5, 50, 2,
                  '<h2 class="rightmenu"><a href="/pages/articles-tutorials.php">Latest Articles</a></h2>', 'read more', 'no articles available', false, '<a>', false, '', 1, 1);
              ?>
This should show the related groups news items in the array i have specified, but whenefver i use the array functions instead of eitehr 0 for all or X for a particular group it returns "no articles avaliable" even thoug htere are news groups with the numbers in the array?

I simply cant get the array part to work? has anyone got any ideas?
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #279 on: April 26, 2009, 06:08:32 PM »
Hi,

please update your function call to the latest version available. The stuff like 'read more' etc. is no longer supported.
The function parameters are described in the Anynews README file. If not already done, please update to version 0.92 of Anynews.

Regards Christian
Logged

abidan

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #280 on: April 26, 2009, 06:10:02 PM »
Hmmmmmmmmm i think it must have been me doing something wrong (probably due to 2 glasses of wine lol) because when i tried it all again this morning it all worked!!!! strange

Thanks for advice anyway :)
Logged

eazybaker

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #281 on: May 06, 2009, 08:40:06 PM »
Quote from: Ruud on October 21, 2008, 02:28:55 PM
I've done this by using 2 news groups. Dutch / English
I didn't set the language in the pages, but used a /pages/en/ or /pages/nl/ page structure.

Code: [Select]
<?php
$url 
= $_SERVER[&#39;REQUEST_URI&#39;];
if (function_exists(&#39;display_news_items&#39;))  {
  
if (strrpos($url,"/en/"))  {
    
display_news_items(1,3,-1,1,"Latest news","read more","No news available",false); 
  } else {
    
display_news_items(2,3,-1,1,"Laatste nieuws","verder lezen","geen nieuws beschikbaar",false); 
  }
} 
?>


Ruud

Hi,i tried that code,but its not working for me,because i use estonian and english language on my site,so
my question is,how i must modify that code to make it work?
thank you :-)

My  Page structure looks like this:
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #282 on: May 06, 2009, 08:56:36 PM »
Hello,

please check out the latest Anynews version, which includes a feature to automatically detect the language from the URL or from the page or section language defined via WB. Details about this feature can be found in Section C of the Anynews README file.

To make this feature working for languages other than German or English, you need to create a Anynews language file for your language and copy it to the Anynews language folder. Currently supported languages are: German (DE.php) and English (EN.php).

If you have created a new Anynews language file, please add it as XX.txt file to this thread and I will add it with a next release of Anynews.

By the way, Anynews language files in other languages like Dutch etc. are also appreciated  :wink:

Regards Christian
« Last Edit: May 06, 2009, 09:12:14 PM by doc »
Logged

eazybaker

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #283 on: May 07, 2009, 12:03:15 PM »
Quote from: doc on May 06, 2009, 08:56:36 PM

If you have created a new Anynews language file, please add it as XX.txt file to this thread and I will add it with a next release of Anynews.

Regards Christian

Hi,tnx i got it working.

Also is it possible to modify it like: when i click on english,it display only news i added to this language,when i click on estonian,then it display only estonian news???
now i have all news i posted on two languages,but can i modify it somehow to display only news from that language what i choose???

Added Estonian language file for anynews as attachment

thank you

[gelöscht durch Administrator]
« Last Edit: May 07, 2009, 12:43:16 PM by eazybaker »
Logged

Offline D72

  • Posts: 295
  • Gender: Male
Re: Code Snippet: Display news items, anywhere
« Reply #284 on: May 07, 2009, 01:47:36 PM »
Hello, i've got two questions.
  • Is it possible to get the title truncated to a certain amount?
  • Is it possible to show the latest events from Event Calendar
On a website i use 'Event Calendar' and the module it self doesnt have the possibility to show the latest
events listed in a block.
Is there any way to grab the latest 4 events with AnyNews?
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #285 on: May 07, 2009, 06:51:36 PM »
Hi,

@eazybaker:
Thanks for the language file. By the way. Does a Estonia language file exists for the WebsiteBaker backend? Guess it should be EE.php but I haven´t found one yet.

Quote from: eazybaker
... but can i modify it somehow to display only news from that language what i choose???
You can add all English news to its own group and all Estonian news to another group. Than you can set the first parameter of Anynews to show one of the groups depending on your page / section.

@D72:
Quote from: D72
Is it possible to get the title truncated to a certain amount?
Sure, but you need to adapt the Anynews code to achieve that. Check for line 187 in the file include.php. This line needs to be adapted e.g. with substr to truncate the title after XX characters.

Quote from: D72
Is it possible to show the latest events from Event Calendar
Well the tool is called anynews not anyeventcalendar, so the answer is no. However, you could copy Anynews rename it to anycalendar and adapt the database queries to fetch content from the calendar table.

Quote from: D72
Is there any way to grab the latest 4 events with AnyNews?
Yes and the HowTo is explained in the README file of the module.

Regards Christian
Logged

doc

  • Guest
Anynews v0.93
« Reply #286 on: May 07, 2009, 07:22:00 PM »
Hello,

just released Anynews v0.93 which includes the Estonian language file contributed by the forum member eazybaker.
At eazybaker - thanks for your contribution, highly appreciated.

Regards Christian
Logged

Offline D72

  • Posts: 295
  • Gender: Male
Re: Code Snippet: Display news items, anywhere
« Reply #287 on: May 07, 2009, 07:43:30 PM »
Quote from: doc
Hi,
...
Regards Christian

Hello Christian,
Thanks for answering.
In order to truncated the titles of anyNews, i shall check this out. I'm not sure about my mysql and database skills, but maybe the the include.php page explains enough for me. I'm certainly give it a try.
About getting headlines by anyNews of the EventCalender...
I will ask this question in the topic of Event Calendar. Maybe someone in there got a brilliant idea.

Also, are you still in the need of a Dutch translation?
I thought it allready has a Dutch file in it.
Wich files should be translated? Only translate EN.php to a NL.php ?
Otherwise, count me in to translate it for you.
It's a good exercise for me to get AnyNews better... Nice module, but for a beginner... a pain in the ass...
Logged

eazybaker

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #288 on: May 07, 2009, 08:33:16 PM »
Quote
You can add all English news to its own group and all Estonian news to another group. Than you can set the first parameter of Anynews to show one of the groups depending on your page / section.
Regards Christian

thank you,i didnt know about this,because i make my first website with WebsiteBaker


Quote from: doc on May 07, 2009, 06:51:36 PM
Hi,

@eazybaker:
Thanks for the language file. By the way. Does a Estonia language file exists for the WebsiteBaker backend? Guess it should be EE.php but I haven´t found one yet.

Yes Estonia language file exists for the WebsiteBaker backend and its EE not EST,so i made mistake,sry abot that

Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #289 on: May 08, 2009, 12:05:34 AM »
Hi,

@eazybaker:
Quote from: eazybaker
Yes Estonia language file exists for the WebsiteBaker backend and its EE not EST,so i made mistake,sry abot that
Strange, I found no EE.php in the WB /language folder. But anyway, thanks for your contribution  :wink:

@D72:
Quote from: D72
In order to truncated the titles of anyNews, i shall check this out. I'm not sure about my mysql and database skills, but maybe the the include.php page explains enough for me. I'm certainly give it a try.
Check out php.net to give it a try. If you fail with your attempts, simply show what you tried and ask for help in this thread.

Quote from: D72
Also, are you still in the need of a Dutch translation?
Sure, so far German, English and Estonian language is supported by default. Just translate DE.php or EN.php (what ever fits best) to NL.php. Please send me a PM once you are done and I will add your translation to the module.

Quote from: D72
... Nice module, but for a beginner... a pain in the ass...
Fully agree. The snippet started with a few options but has grown over time. Any kind of help (e.g. with the README file etc.) is therefore welcome. Sometimes it is hard for a "developer" to write a documentation which fits the needs of the "end users".

Regards Christian
Logged

eazybaker

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #290 on: May 08, 2009, 08:04:37 AM »
Quote from: doc on May 08, 2009, 12:05:34 AM
Hi,

@eazybaker:
Quote from: eazybaker
Yes Estonia language file exists for the WebsiteBaker backend and its EE not EST,so i made mistake,sry abot that
Strange, I found no EE.php in the WB /language folder. But anyway, thanks for your contribution  :wink:
Regards Christian

Yes,becaue i didnt looked into website backer languages folder before :wink:

i found this http://en.wikipedia.org/wiki/Estonian_language and there are only et,and est,but i have seen ee also on many translated scripts,so i think its ok :-)
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #291 on: May 08, 2009, 08:52:23 AM »
Hi,

@eazybaker: WB is following the ISO 3166-1 language codes (2 characters).

Regards Christian
Logged

doc

  • Guest
Anynews v0.94 released
« Reply #292 on: May 08, 2009, 03:49:21 PM »
Hello,

just released v0.94 of Anynews which includes the Dutch language file and the Dutch README file contributed by the forum member Dave (ak D72). Funny to see a Dutch README before a German one  :-)

Dave, thank you very much for your support - highly appreciated.

Regards Christian
« Last Edit: May 08, 2009, 03:51:09 PM by doc »
Logged

Deleen

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #293 on: May 20, 2009, 02:59:35 PM »
Hello,

i am also start to use anynews in my project. By the way - these picture Problem is also on my side.
Soon as i have a Picture in the short test it is break. I put the outputfilter to "false" and i try with "true" and allow <img>-tag.

I have already the newest version. I saw - this problem was nemes in the tread - but i couls not found real solution. So please - can somebody help?
Logged

Deleen

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #294 on: May 20, 2009, 03:08:48 PM »
Forgot my problem - i found a asolution, the character setup was to short - is news leght was 50 - if i set it heigher, it works :) .

Greats, Kathleen
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #295 on: May 26, 2009, 03:56:50 PM »
Hello,

just released v1.00 of the Anynews code snippet on the WebsiteBaker Add-ons repository.
The English Readme file is up to date, the Dutch one needs to be updated.

Changes:
The latest version includes a new display options ($display_option = 3) which uses jQuery and some JQuery-Plugins developed by Ariel Flesler to display news with the Coda Slider Effect.

To use this option, one needs to add an additional code line into the index.php file of your template.
Code: [Select]
<?php include_once(WB_PATH . &#39;/modules/anynews/coda-slider.inc.php&#39;); ?>
This mode does also work with Javascript disabled, but without visual effect in that case.

Have fun
Christian
« Last Edit: May 26, 2009, 05:37:03 PM by doc »
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Code Snippet: Display news items, anywhere
« Reply #296 on: May 26, 2009, 04:16:07 PM »
Sounds great,

Quote from: doc on May 26, 2009, 03:56:50 PM
The latest version includes a new display options ($display_option = 3) which uses jQuery and some JQuery-Plugins developed by Ariel Flesler to display news with the Coda Slider Effect.

Do you have a demo of this one somewhere? (could use it for a new article on my site)

Ruud
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #297 on: May 26, 2009, 05:40:00 PM »
Hi Ruud,

seems jqueryfordesigners. com had some server problems. Tried it some seconds ago and the demo seems to work again.: http://jqueryfordesigners.com/demo/coda-slider.html

The Anynews Coda Slider output is very close to the one posted at jqueryfordesigners. com. Just give it a try on a local test environment, it isn´t that much work to set it up  :-)

Regards Christian

P.S.: In case it does not work, I can send you a link with the pure HTML files for the Coda Slider demo.
« Last Edit: May 26, 2009, 05:51:24 PM by doc »
Logged

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4548
  • Gender: Male
Re: Code Snippet: Display news items, anywhere
« Reply #298 on: May 26, 2009, 05:49:59 PM »
Hi,

or look at this

YCodaSlider 3.0

Copyright (c) 2009 Massimiliano Balestrieri
Examples and docs at: http://maxb.net/blog/

greetings
Dietmar
Logged
Note: Once the code has been generated, it is easy to debug. It's not a bug, it's a feature!

doc

  • Guest
Anynews v1.10 released
« Reply #299 on: May 31, 2009, 03:05:03 PM »
Hi,

just released v1.10 of the Anynews code snippet on the WebsiteBaker Add-ons repository.
The English Readme file is up to date, the Dutch one is outdated and needs to be updated.

Applied changes:
Added some more default placeholder which can be used in the output (e.g. {DISPLAY_NAME}, {USERNAME}, {GROUP_TITLE} ... The full list of placeholders available can be found in the template file: custom_output_display_mode_4.htt ($display_mode:=4).

More advanced feature:
The function parameter $show_publish_date was replaced with the new parameter $custom_placeholder which allows users to define their own placholder variables by regular expression. If the regular expression matches, additional placeholders are avaialbe for usage in the template files. Details about this can be found in the README file.

If you have used $show_publish_date = false to hide the publish dates, just remove   the placeholder {PUBLISH_WHEN} from your template filed (folder /htt) to achieve the same effect.

Example:
Code: [Select]
$custom_placeholder:= array('IMG_LINK' => '%img%', 'MY_VAR' => '#(test)#i')
The code above searches the long and short news content for optional image tags (%img%) and text string 'test' (#(test)#i). Assuming, the news long text field contains two image tags and both, short and long text field contains the string 'test', the following additional placeholders can be used inf the template files:
Code: [Select]
LONG_IMG_LINK_1, LONG_IMG_LINK_2
SHORT_MY_VAR_1, LONG_MY_VAR_1

User defined variable names (e.g. MY_VAR turns into: PREFIX_MY_VAR_INDEX, where PREFIX is LONG/SHORT for long or short content field).

Have fun
Christian
« Last Edit: May 31, 2009, 03:30:11 PM by doc »
Logged

  • Print
Pages: 1 ... 10 11 [12] 13 14 ... 21   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Code Snippet: Display news items, anywhere
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2