News Flash Content Type [Updated 2.0.4]

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

News Flash Content Type [Updated 2.0.4]

Post by JensZ »

Hi all,

New update of the newsflash content part available: v2.0.4.

It can be used to display article listings in any block and even inside other articles.

The code can be downloaded from: http://www.ikfrej.se/index.php?downloads

Here's the readme file:

Code: Select all

------------------------------------------------------------
Latest changes
------------------------------------------------------------
2005-09-15   Jens Zetterström   Version 1.0.0
* Initial write
2005-10-11   Jens Zetterström   Version 1.0.1
* Fixed issue where articles was sorted incorrectly.
* Fixed so it also works for default article template.
2005-12-15   Jens Zetterström   Version 2.0.0
* Now possible to select whole 
  categories with articles to be listed. 
* Includes new reptag {NEWSFLASH}
* This is a new content type (#90). The reason is that
  the enhancements would cause your old newsflash content
  parts to stop working.
2006-01-04   Jens Zetterström   Version 2.0.1
* Possible to select template as specified in the article 
  (i.e no overriding template).
2006-09-15   Jens Zetterström   Version 2.0.2
* Patched for 1.2.8.
* Added setting for maximum articles to be shown. Leave empty for all.
2007-04-20   Jens Zetterström   Version 2.0.3
* Sorting of articles by creation date, title, modified date, etc.
* Fixed broken RT
2007-05-30   Jens Zetterström   Version 2.0.4
* Paging of article list
* Max number of words in summary

------------------------------------------------------------
Summary
------------------------------------------------------------
I found the need to be able to display article listings
in any block of my PHPWCMS website. I decided to enhance
the article list content part slightly so that it used the
article list templates to display the selected articles.
In conjunction with Content Part Alias or my {SHOW_CONTENT}- 
replacement tag, it permitted a very flexible way of 
displaying article listings anywhere, even inside articles.


------------------------------------------------------------
Content
------------------------------------------------------------
1. Installation
2. Usage
3. Known Issues
4. Bugs & Suggestions
5. Credits & License


-------------------------------------------------------------
1. Installation
-------------------------------------------------------------
1. Download from http://www.ikfrej.se/index.php?downloads

2. Unzip the package

3. Backup the following files:
		include/inc_lib/article.contenttype.inc.php
		include/inc_tmpl/articlecontent.edit.tmpl.php

4. Upload the include folder (and everything in it) to the
   website root directory.
	
5. If you had installed newsflash 2.0.x before, you must 
	remove the following functions from inc_front/ext.func.inc.php or inc_front/front.func.inc.php:
		list_newsflash_summary()
		get_newsflash_articles_data()
		get_newsflash_article_list()

   
-------------------------------------------------------------
2. Usage
-------------------------------------------------------------
Newsflash v2 Content Type #90:
1. Choose "News Flash v2" as content part
2. Select the article listing template you want to use (this 
   will override the article's own article listing template)
3. Select articles and categories.
4. Hit update.

NEWSFLASH reptag:
{NEWSFLASH:art_&_cat[,more_art_&_cat][:art_list_template]}
where 
   art_&_cat are article IDs (with prefix 'a') and 
   category IDs (with prefix 'c'). 
   art_list_template is the overriding article listing 
   template.

Example:
{NEWSFLASH:c29,a167,a143:sample.tmpl}
will list all articles in category 29 and article with IDs
167 and 143.


-------------------------------------------------------------
3. Known Issues
------------------------------------------------------------- 
#0001 Removing articles from the top select box will screw
      up the bottom one. 

-------------------------------------------------------------
4. Bugs & Suggestions
------------------------------------------------------------- 
If you find any kind of bugs or you have any suggestions. 
Please send an E-Mail to: webmaster@ikfrej.se 


-------------------------------------------------------------
5. Credits & License
------------------------------------------------------------- 
This script is developed by Jens Zetterström and released under 
The GNU General Public License.

Regards,

Jens
Last edited by JensZ on Wed 30. May 2007, 12:06, edited 5 times in total.
tinoo
Posts: 311
Joined: Thu 16. Jun 2005, 11:16
Location: Zürich, Switzerland
Contact:

Post by tinoo »

Is there a running example?
Greetz, tinoo
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

Post by JensZ »

Well... yeah, but not a good one. On my site there is a small example where it says "Notiser" in the right paragraph. Basically, it is an article listing with a very basic article list template. It could have been a list of articles like the one to the left, with summary text, pictures, etc. I have a hidden structure where I store the article(s) in the list and the news flash content part where I selected the articles. Then I use {SHOW_CONTENT} with the news flash content part ID in the right paragraph. I hope you get the gist.
User avatar
Fulvio Romanin
Posts: 394
Joined: Thu 4. Dec 2003, 11:12
Location: Udine, Italy
Contact:

Post by Fulvio Romanin »

well, a small demo would be much appreciated ;)
Completeness is reached through subtraction, not through addition
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

wow

Post by jsw_nz »

Nice Job JensZ,

I just downloaded and took a first look at your mod.....which looks great. I think this is the first time I have seen anyone offer a new contentpart for wcms. In fact...I have now bookmarked your download page...very nice job :) . OliG has mentioned 'something is planned' with regards to what your mod accomplishes, so here is hoping this gets included.

Since you are quite the programmer, have a wee little thread for you to take a look at.

Kosse's Thread
http://www.phpwcms.de/forum/viewtopic.php?t=7271

The topic has been raised several times on the boards, namely...a way to have list and fullarticle templates preselected. Myself and others have encountered that when handing a job over to client, this part of desinging of content is confusing and often overlooked by them. pSouper has developed a hack to at least change this (in part), but the discussion has blossomed into the concept of providing control of these parameters from backend (site structure)(page templates)(article) locations. So just wanted to point you to this thread.

Would be interested if you had any ideas or approaches of how to accomplish this from a programming perspective.

RESPECT.

:D :D
coopersred
Posts: 35
Joined: Thu 8. Apr 2004, 14:40

Post by coopersred »

I found your content part works fine except for one bug.

If I choose "default" for the template setting the content does not show.

It only shows when I choose "sample.tmpl" for the template setting.
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

Post by JensZ »

I'll take a look at it. I'm very busy the upcoming weeks, but I hope I can get around to it soon.

Cheers,

Jens
coopersred
Posts: 35
Joined: Thu 8. Apr 2004, 14:40

Post by coopersred »

There seems to be no way to adjsut the order of the artiles manually. Is this by design or is it a bug?

In the "link Article" content part you can manually adjust the order of the artilces but this is not working in the "News Flash" content part.

I've been trying to work it out by looking at your code but I'm a complete newbie to PHP coding.
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

Post by JensZ »

Then it's a bug!
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

Post by JensZ »

Now I've fixed both problems (I hope).

Download Newsflash-1.0.1.zip at: http://www.ikfrej.se/index.php?downloads

For those who already installed it, you only need to replace the functions get_newsflash_articles_data() and list_newsflash_summary() in front.func.inc.php.

Cheers,

Jens
coopersred
Posts: 35
Joined: Thu 8. Apr 2004, 14:40

Post by coopersred »

Sorted
Last edited by coopersred on Tue 11. Oct 2005, 17:54, edited 1 time in total.
coopersred
Posts: 35
Joined: Thu 8. Apr 2004, 14:40

Post by coopersred »

That was quick.

It's working perfect now.

Good job. Well done.
JensZ
Posts: 136
Joined: Wed 16. Feb 2005, 12:18
Location: Stockholm, Sweden
Contact:

Post by JensZ »

Glad I could help.

I'm curious to see how you're using it. Do you have an example?
User avatar
anthony.abraira
Posts: 99
Joined: Sun 11. Sep 2005, 07:42
Location: Mars Hill, NC
Contact:

Post by anthony.abraira »

I installed the News Flash feature and came up with the error below when I tried to post the content part:

Code: Select all

Fatal error: Call to undefined function: list_newsflash_summary() in /home/d15642/public_html/include/inc_front/content/cnt88.article.inc.php on line 36
I did the installation a little more cautiously. Since I was terrified of messing anything up, I went into the .nf files and looked at what you put in. I then copied and pasted these pieces in the exact location as you did. I went ahead and doublechecked and everything looks in place.

By the way Jens thanks for the help you have been giving. Making leap and bounds with whatever you can contribute.

Respect

aa
User avatar
anthony.abraira
Posts: 99
Joined: Sun 11. Sep 2005, 07:42
Location: Mars Hill, NC
Contact:

A Fatal Error: More than likey due to my goof!

Post by anthony.abraira »

I installed the News Flash feature and came up with the error below when I tried to post the content part:

Code: Select all

Fatal error: Call to undefined function: list_newsflash_summary() in /home/d15642/public_html/include/inc_front/content/cnt88.article.inc.php on line 36
I did the installation a little more cautiously. Since I was terrified of messing anything up, I went into the .nf files and looked at what you put in. I then copied and pasted these pieces in the exact location as you did. I went ahead and doublechecked and everything looks in place.

By the way Jens thanks for the help you have been giving. Making leap and bounds with whatever you can contribute.

Respect

aa
Post Reply