{SHOW_ARTICLE_CALENDAR}{SHOW_ARTICLES} combo
Posted: Mon 31. Jul 2006, 05:21
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)
****************************************
****************************************
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)
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,
john
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)
****************************************
****************************************
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 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,
john