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 ... 7 8 [9] 10 11 ... 21   Go Down

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

testdriver2

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #200 on: November 18, 2008, 12:56:46 PM »
I would like to thank the website baker community for providing excellent modules. I have used the latest version of the module provided on this site and I have integrated it into my website www.auyana.de.
Logged

spida

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #201 on: November 20, 2008, 05:57:33 PM »
Wow, cool design! There's a forum called showcase here in the community forum. Maybe you want to introduce your website there.

Cheers,
spida
Logged

spida

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #202 on: November 20, 2008, 06:44:02 PM »
Hi there,

I don't get the display working.
If I use this code according to the readme
Code: [Select]
if (function_exists('display_news_items')) {
    display_news_items(9, 5, 50, 1,
'Best Practice Beispiele', 'Weiterlesen', 'Momentan in Bearbeitung...',
false, '<a><img>', true, ' (d.m.Y)');
}

I only get text, some tags, no link for the full text, no images, and everything in very big letters (see image 01).

If I change strip tags from false to true, it's still the same, just in smaller letters (see image 02)

In either case images are not displayed, but there alternative text instead.

It would be really nice if someone checks my code and tells me what I am doing wrong here. I am a bit clueless right now, can't see the error in it.

Thanks in advance,
spida

[gelöscht durch Administrator]
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #203 on: December 10, 2008, 07:27:08 AM »
Hello,

anynews v0.21 showed an warning (E_ALL) if the anynews function was called more than once on one page. This is fixed in the latest version 0.22 available on the add-ons repository. Just download the latest version and install it over the existing one via the WB backend.

Regards Christian
Logged

erpe0812

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #204 on: December 10, 2008, 10:28:49 PM »
Hello

I did not get the publish date displayed at my anynews code-section:
Code: [Select]
display_news_items(2, 5, 150, 1,
  'Latest News','Details', 'uups, no news available',
  true, '<a><img>', true,'(h:i, d.m.Y)');

Any suggestions?

rgds

erpe
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Code Snippet: Display news items, anywhere
« Reply #205 on: December 10, 2008, 10:42:23 PM »
Hello.
Do you mean here?:
http://www.websitebakers.com/

Strange.
It should work.

Did you notice any another problems with the standard modules?

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

erpe0812

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #206 on: December 10, 2008, 10:47:32 PM »
Quote
Do you mean here?:
http://www.websitebakers.com/
Yes.
And no: there are no problems (known) on the site.
But there is another site with the same result.

rgds

erpe
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Code Snippet: Display news items, anywhere
« Reply #207 on: December 10, 2008, 10:51:36 PM »
If the another site is hosted by the same provider...  :wink:
else ... I don't know.

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

erpe0812

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #208 on: December 10, 2008, 11:10:15 PM »
No,
another hoster.

rgds

erpe
Logged

doc

  • Guest
Anynews v0.30 beta
« Reply #209 on: December 10, 2008, 11:13:28 PM »
Hello guys,

please find attached a beta version of the next anynews release.

Installation / De-installation:
As this version uses the same parameter list as the previous versions, there is no need to modify existing calls. Simply install v0.30 (beta) over an existing version via the WB backend and you are done. If you experience any problems, de-install the beta version via the WB backend and install the stable version v0.22 from the add-ons repository.

Whats new:
Version v0.30 (beta) uses two HTML template files located in: "modules/anynews/htt" to style the output for the list format and the detailed output. This allows to add or remove any tags you want without touching the PHP code itself. This way, one can realize table or div based outputs of the news items without touching a single line of PHP code.

The following placeholders can be used in the "*.htt" files:
Quote
NEWS INFO: {TITLE}, {POSTED_WHEN}, {CONTENT_SHORT}, {LINK}
FUNCTION ARGUMENTS: {ARG_HEADER_TEXT}, {ARG_READMORE_TEXT}, {ARG_NO_NEWS_TEXT}
Note: the "no news text" is added automatically if no news exist.

The placeholder {TITLE} contains the title of the news article from the news database, whereas {ARG_HEADER_TEXT} contains the text passed to the function as 5th parameter ($header_text).

Think this modification in combination with CSS should allow alos users not that familar with PHP to modify the output according their needs.

As usual, feedback, comments or proposals welcome.

Regard Christian

[Edit]File removed. Lastest version available from addons repository[/Edit]
« Last Edit: December 13, 2008, 12:10:28 PM by doc »
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Code Snippet: Display news items, anywhere
« Reply #210 on: December 10, 2008, 11:38:13 PM »
Cool stuff, Doc.

Will test tomorrow.

@Erpe... in this case - I don't know.

Regards,
Stefek
« Last Edit: December 11, 2008, 01:51:42 AM by Stefek »
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

erpe0812

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #211 on: December 11, 2008, 12:47:35 AM »
Hi Doc,

sorry for the question, but how can I use this?

rgds


erpe
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #212 on: December 11, 2008, 07:11:46 AM »
@Erpe:
Install anynews v0.30 locally and check out the files contained in /htt. The files are pure text files containing HTML tags and placeholders like {TITLE}. This files control the order and overall apearance of the news output. There is a help file contained in the module.

There were a lot of discussions in this thread regarding moving outputs from a to b, to get rid of paragraph tags etc. creating div or table layouts. The previous solutions required to touch the PHP code and a lot of end users are not that familar with doing this. Therefore I decided to introduce the HTML template files to make it more practicable. The files may be editable by the use of the "edit module files" module.

For abaut 80% of the users nothing will change, the other 20% have the freedom to style the output like they want.

Christian
Logged

doc

  • Guest
Code Snippet: Display news items, anywhere
« Reply #213 on: December 13, 2008, 12:16:02 PM »
Hello,

just released Anynews v0.31 on the Add-ons Repository.

Installation / De-installation:
Simply download the latest version and install it via the WebsiteBaker backend. No need to de-install existing version

Whats new:
  • possibility to style text output via template files located in anynews/htt/*.html
  • two new parameters to sort news by position or posted_when in decending or ascending order

The template files (pure HTML) allows you style the output without touching the PHP code of the module itself. Details can be found in the module help file.

Regard Christian
Logged

Offline Katerchen

  • Posts: 84
Re: Code Snippet: Display news items, anywhere
« Reply #214 on: December 28, 2008, 09:54:09 AM »
Great enhancement! I just wanted to start modifying v0.21 because I need some changes to the default layout of the news entries in v0.21, but v0.31 makes this obsolete as I can modify the template files now. Exactly what I nedded. Thank you!

There are just two modifications I still have to make:

1. Why is max_news_items limited to a maximum of 10? Currently there is no way to change this hard-coded limit without modifying the PHP code (which is trivial though). Parameter checking is always a good idea, but why this very low maximum value? Why not set it to a higher value (e.g. 1000, the default could be left to 10 to maintain as much backward compatibility as possible)?

2. I would like to have an additional placeholder that uses the database field published_when instead of posted_when (for displaying and/or sorting). The field published_when is visible and settable in the backend via "Start date" while posted_when is not. Again, it doesn't seem to be very difficult to implement, so I'm going to try this soon.

At least #2 could be implemented as an enhancement to v0.31 which is 100% backward compatible - is there any interest in it?
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #215 on: December 30, 2008, 02:02:29 PM »
Hello,

both can be implemented with the next release. The field published_when was first introduced with WB 2.7. Setting 10 as max. was in my opinion a good choice, but can easily be changed.

Regards Christian
Logged

Offline Katerchen

  • Posts: 84
Re: Code Snippet: Display news items, anywhere
« Reply #216 on: December 30, 2008, 03:08:22 PM »
This is good news! One more suggestion: The template files are hardcoded as well. This prevents the author of a website from using different templates in different news pages, which could be very handy, because the news module can also be used for other kinds of pages than just displaying news which sometimes requires different formatting.

Why not make the template filename (or its subdirectory name "htt") selectable via a parameter? This would enhance the flexibility of the snipped by far and is probably easy to implement.

Happy New Year!
Logged

chabar2000

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #217 on: January 04, 2009, 10:04:56 AM »
Does anybody have the same problem: max_news_length does not work, short text is always shown completely.
Code: [Select]
<?php
if (function_exists(&#39;display_news_items&#39;)) { display_news_items(0, 2, 10, 1,   &#39;News&#39;, &#39;Read more...&#39;, &#39;No news&#39;); } ?>
Any hint? Thank you!
Karl
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #218 on: January 04, 2009, 08:22:06 PM »
Hello,

just released Anynews v0.32 on the Add-ons Repository.

Installation / De-installation:
Download the latest version from the WebsiteBaker Add-ons repository. Uninstall previous versions of Anynews via the WebsiteBaker backend if available, then install the latest version.

Whats new:
  • fixed bug with $max_news_length (setting was ignored from 0.30 onwards)
  • added placeholder {PUBLISHED_WHEN} which can be used in the templates files (/htt)
  • added possibility to define custom template output files by setting $display_mode (3..99); requires a file called "custom_output_displ ay_mode_X.htt in the /htt folder)
  • increased max. value of $max_news_items from 10 to 999 (min:=1, max:=999, default:=10)

Details can be found in the module help file.

Regard Christian
« Last Edit: January 05, 2009, 12:05:54 AM by doc »
Logged

Offline albatros

  • Posts: 696
  • Gender: Male
    • http://www.willingen-ferienhaus.de
Re: Code Snippet: Display news items, anywhere
« Reply #219 on: January 05, 2009, 03:46:46 PM »
Hi Christian,

it's my favorite module, so I want to thank you for your work!

Best regards

Uwe
Logged
أنا لست إرهابيا. ليس لدى أي ورشة عمل القنبلة في الطابق السفلي. ليس لدى أي مرض الجمرة الخبيثة أيضا. أريد شراء لا مادة الريسين. أنا سوف ابدأ السفر إلى الولايات المتحدة الأمريكية

Offline Katerchen

  • Posts: 84
Re: Code Snippet: Display news items, anywhere
« Reply #220 on: January 06, 2009, 01:10:27 PM »
Excellent! It's getting more and more flexible and works well here. Thank you!

Would it make sense to add a third "sort_by" parameter (e.g. 3) which sorts by the field PUBLISHED_WHEN? In this case the field PUBLISHED_WHEN could be taken as a creation date which is visible/modifyable via the backend and automatically sorted by this date.

Is it really necessary to deinstall the old version first before installing a newer version?
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Code Snippet: Display news items, anywhere
« Reply #221 on: January 06, 2009, 01:22:45 PM »
Quote from: Katerchen on January 06, 2009, 01:10:27 PM
Would it make sense to add a third "sort_by" parameter (e.g. 3) which sorts by the field PUBLISHED_WHEN? In this case the field PUBLISHED_WHEN could be taken as a creation date which is visible/modifyable via the backend and automatically sorted by this date.

I would also appraciate seeing this happen.

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #222 on: January 06, 2009, 03:40:26 PM »
Hello,

just released Anynews v0.33 on the Add-ons Repository.

Installation / De-installation:
Download the latest version from the WebsiteBaker Add-ons repository. Uninstall previous versions of Anynews via the WebsiteBaker backend if available, then install the latest version.

Whats new:
  • added possibility to sort news by published_when column ($sort_by :=3)

Details can be found in the module help file.

Regard Christian

@Katerchen: Yes it is required to delete an existing version, as I have changed filenames which will not be deleted via the normal update procedure. However, as Anynews is a code snippet, you do not need to delete any page or code section before uninstalling the module as it is the case for page modules like Zitate, Guestbook ...
Logged

Offline Katerchen

  • Posts: 84
Re: Code Snippet: Display news items, anywhere
« Reply #223 on: January 06, 2009, 04:23:07 PM »
Just installed v0.33 - sorting by published_when works great! But now sort_by = 1 seems to be broken - it sorts by published_when also. Take a look at line 114 in include.php - does this construction really work?

Edit: I just replaced
Code: [Select]
$sql_sort_by = ($sort_by == 1) ? 'position' : ($sort_by == 3 && $add_sql != '') ? 'published_when' : 'posted_when';
with a nested "if" clause and it worked again, so this line seems to be the culprit.
« Last Edit: January 06, 2009, 04:30:35 PM by Katerchen »
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #224 on: January 06, 2009, 05:22:00 PM »
Hi,

well missed a bracket pair. The line below should work as expected.

Code: [Select]
$sql_sort_by = ($sort_by == 1) ? 'position' : (($sort_by == 3 && $add_sql != '') ? 'published_when' : 'posted_when');
Have replaced the version on the Addon repository (still labeled version v0.33, so delete an existing version and replace it with the new one).

Regards Christian
Logged

  • Print
Pages: 1 ... 7 8 [9] 10 11 ... 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