{SHOW_ARTICLE_CALENDAR}{SHOW_ARTICLES} combo

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

{SHOW_ARTICLE_CALENDAR}{SHOW_ARTICLES} combo

Post by jsw_nz »

Hi All,

Been working on a personal project (kind of a psuedo blog) on my localhost - which I plan to port to the web. As part of this project, I have developed a 'article calendar' that can be queried by day and/or month. Helpful for my own requirements - just to keep track of work and files. I am releasing it to the community - with the hope the a few others might find it useful. It is a beta and will require testing.

Looks like this
(It is CSS Driven - not tested in tables setting)

****************************************
Image
****************************************

The {SHOW_ARTICLES} code was drawn in large part from Erich's Great {TEASER_EX} -- so big thanks to Erich is mentioned here --
Here are comments that are included in zip (bottom of post)

Code: Select all

{SHOW_ARTICLE_CALENDAR}  replacement tag
* developed by jsw_nz (john) for phpWcms
* released as beta - 
please report bugs and suggestions to:
jswnz@xtra.co.nz

*July 30, 2006 (beta 0.5)
 // requirements: mysql >= 4.x, phpwcms ver >= 1.2.x 
--------------------------------------------------------------------------------------------
copy this file to phpwcms_template\inc_script\frontend_render
--------------------------------------------------------------------------------------------
FUNCTION:
Provides a calendar display of articles postings sorted by month using creation_date parameter 
Can return articles from all categories OR return articles based on supplied category ID 
(1) In cases where only one article is found - creates hyperlink to that article   
>>>  _.index.php?id=XX,YY,0,0,1,0     or    _. XX.YY.0.0.1.0.phtml  if $phpwcms["rewrite_url"] = 1;
(2) In cases where more than one article is found, creates hyperlink to redirect page. 
Redirect page parses the GET parameter 
>>> _.index.php?show_articles&d=20060729  or  _.show-articles&d=20060729.phtml
--------------------------------------------------------------------------------------------
Redirect Page Instructions see {SHOW_ARTICLES} instructions - below
(1) Requires the creation of a separate category in backend that matches $redirectLink string IE alias: show_articles
(2) an article for that category with the replacement tag {SHOW_ARTICLES} found within it.
--------------------------------------------------------------------------------------------
Calendar is driven by CSS - see calendar.css provided in zip - modify to suit
Impementation in ""tables based setting may require additional editing"" of css
USAGE:
--------------------------------------------------------------------------------------------
{SHOW_ARTICLE_CALENDAR:0} - returns all articles regardless of category
{SHOW_ARTICLE_CALENDAR:2} - returns all articles of category ID (2) - good for simple news section 
--------------------------------------------------------------------------------------------
*/

/* ----------------------------------------------------------------------------------------
{SHOW_ARTICLES}  replacement tag
* developed by jsw_nz (john) for phpWcms 
* released as beta - please report bugs and suggestions to:
jswnz@xtra.co.nz
*July 30, 2006 (beta 0.5)
A large section of this code draws from TEASER_EX replacementtag (by Erich Munz, 2006)
BIG THANKS to ERICH !!!!
It does not include many of the more elaborate formatting and parameter options - its a poor main's version - hehe
 // requirements: mysql >= 4.x, phpwcms ver >= 1.2.x 
--------------------------------------------------------------------------------------------
copy this file to phpwcms_template\inc_script\frontend_render
--------------------------------------------------------------------------------------------
FUNCTIONS
Outputs articles in SUMMARY FORMAT (defined in backend) according to date parameter
(1) d=20060729 - YYYYMMDD  - calendar sends this parameter from individual day hyperlinks
in this case outputs articles for a given day
(2) d=200607 - YYYYMM - (no day parameter included) - calendar header (prev - next) sends this parameter
in this case outputs articles for an entire month - similar to monthly archive
(3) if  d=..... parameter is not defined...the script outputs results for the last 30 days
ALSO: paramters can also be sent via embedded links elsewhere in phpwcms - for custom output
--------------------------------------------------------------------------------------------
INSTRUCTIONS
(1) Requires the creation of a separate categories in backend IE alias: show_articles, show_news_articles, etc
(2) Requires an article for that category with the replacement tag {SHOW_ARTICLES:[INT]} to be found within it.
--------------------------------------------------------------------------------------------
USAGE:
--------------------------------------------------------------------------------------------
{SHOW_ARTICLES:0} - returns all articles regardless of category
{SHOW_ARTICLES:2} - returns all articles of category ID (2) 
- good for simple news section 

Special Note: dont forget to sychronize !
{SHOW_ARTICLES:0}  with {SHOW_ARTICLE_CALENDAR:0}  
{SHOW_ARTICLES:2}  with {SHOW_ARTICLE_CALENDAR:2}  
etc..

sending category parameters via GET is on the todo list....
--------------------------------------------------------------------------------------------
*/
The zip provides two php files (one for each tag), a readme and a calendar.css file (that you will need to copy and paste into your installation's default css)

The zip can be downloaded here:

http://www.designjournal.co.nz/wcms/sho ... 8_2006.zip
UPDATED from show_article_calendar.zip
to fix month changeover bug -
now stores the calendar info in a Session.

All best,
:D :D
john
Last edited by jsw_nz on Mon 25. Dec 2006, 20:29, edited 4 times in total.
fopulu
Posts: 359
Joined: Tue 2. May 2006, 14:19
Location: Rhein-Main

Post by fopulu »

Can we see a online demo?
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Hi Fopulu,

Sorry, everything is now installed on my localhost atm.

I did notice a wee bug.

Over here in New Zealand the month rolled over from July to August - so I added a session feature to store the selection criteria of calendar to maintain state.
I reposted the zip wihich is renamed:

show_article_calendar_08_2006.zip
see original post for link to download

all best,
john :D
Ben_Hook
Posts: 29
Joined: Sun 4. Dec 2005, 21:19

CSS

Post by Ben_Hook »

Could somebody send the zip file; the link is broken and I need the css file...
  • If i bore you to death, don't say i didn't warn you.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Should be updated now :)
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post by flip-flop »

Hi john,

the link is stil broken. :lol:

Merry christmas

knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post by juergen »

All we need is a TLD :D

info ?

com ?

net ?
Eggi
Posts: 15
Joined: Thu 20. Oct 2005, 11:26

Post by Eggi »

i think he is from new zealand
also look the

http://www.designjournal.co.nz/wcms/sho ... 8_2006.zip

:wink:
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Sorry guys - my bad

Updated the link (at top) of page -
Eggi is right - was my typo - now fixed

:)
Ben_Hook
Posts: 29
Joined: Sun 4. Dec 2005, 21:19

Post by Ben_Hook »

Thanks! I didn't expect a reply that fast.. but then again i never do :lol:
  • If i bore you to death, don't say i didn't warn you.
Post Reply