================================================
 News & Articles Management 2Pmod3 Installation
================================================

NOTE: This version is for ZenCart 1.3 only

New install
-----------
   1. Copy files from _zen_cart_folder to your Zen Cart install
   2. If you are using a template folder other than the default Zen Cart
      "classic" template folder, copy the files from the classic
      template in the download (includes/templates/classic) to your
      custom template folder (includes/templates/your_template_folder)
   3. CHMOD the following directories in your Zen Cart install so that
      PHP can write to them (this value is usually 777, but might be 755
      on some systems):
        images/news/images_small/
        images/news/images_med/
   4. Import SQL file _install_sql/INSTALL_2Pmod3_EN.sql to your DB using
        Admin->Tools->Install SQL Patches
   5. Perform "Optional Install - Dynamic Page Titles for News Pages"
      below if you wish for the news pages to have dynamic page titles
      (Highly Recommended)
   6. Perform "Optional Install - News Summary Module" below if you
      wish to use the News Summary module on the main index page
      (Highly Recommended)
   7. Setup Configuration from
        Admin->Configuration->News & Articles Management
   8. Main News page access from the URL
        http://YourZenCartUrlPath/index.php?main_page=news
      (Can place a link wherever you want - i.e, in your site's header,
      information box, etc. or install optional news sidebox.)
   9. Access News & Article admin pages from
        Admin->Catalog->News & Articles - Articles and
        Admin->Catalog->News & Articles - Authors
        
Optional Install  Dynamic Page Titles for News Pages (HIGHLY RECOMENDED)
--------------------------------------------------------------------------
1. For a fresh Zen Cart Install, copy file
     _optional_install/includes/modules/meta_tags.php
   to your Zen Cart install.

2. For all other installs, open your Zen Cart file 
     includes/modules/meta_tags.php
   and insert (before original line no. 297) code between comments
     // 2P modified BOF - News & articles Management
     // 2P modified EOF - News & articles Management
   hereby:
............................................................................................................................
    $review_text_metatags = substr(strip_tags(stripslashes($review_metatags->fields['reviews_text'])), 0, 60);
    $reviews_rating_metatags = SUB_TITLE_RATING . ' ' . sprintf(TEXT_OF_5_STARS, $review_metatags->fields['reviews_rating']);
    define('META_TAG_TITLE', str_replace('"','',$meta_products_name . $meta_products_price . PRIMARY_SECTION . TITLE . TERTIARY_SECTION . NAVBAR_TITLE));
    define('META_TAG_DESCRIPTION', str_replace('"','',TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . $meta_products_name . SECONDARY_SECTION . $review_metatags->fields['customers_name'] . SECONDARY_SECTION . $review_text_metatags . ' ' . SECONDARY_SECTION . $reviews_rating_metatags));
    define('META_TAG_KEYWORDS', str_replace('"','',KEYWORDS . ' ' . $meta_products_name . ' ' . $review_metatags->fields['customers_name'] . ' ' . $reviews_rating_metatags));
  } // EOF
  break;

// 2P modified BOF - News & articles Management
	case 'news':
    if (isset($_GET['date']) && zen_not_null($_GET['date'])) {
    	define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . SECONDARY_SECTION : '') . zen_date_long($date) . PRIMARY_SECTION . TITLE . TAGLINE);
		} else {
	    define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . PRIMARY_SECTION : '') . TITLE . TAGLINE);
		}

    define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
    define('META_TAG_KEYWORDS', KEYWORDS . ' ' . NAVBAR_TITLE);
		break;

	case 'news_article':
   	define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . SECONDARY_SECTION : '') . $article->fields['news_article_name'] . PRIMARY_SECTION . TITLE . TAGLINE);
    define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
    define('META_TAG_KEYWORDS', KEYWORDS . ' ' . NAVBAR_TITLE);
		break;

	case 'news_comments':
   	define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . SECONDARY_SECTION : '') . $article->fields['news_article_name'] . SECONDARY_SECTION . NAVBAR_TITLE_COMMENTS . PRIMARY_SECTION . TITLE . TAGLINE);
    define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
    define('META_TAG_KEYWORDS', KEYWORDS . ' ' . NAVBAR_TITLE);
		break;

	case 'news_archive':
   	define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . SECONDARY_SECTION : '') . news_date_archive($archive_date) . PRIMARY_SECTION . TITLE . TAGLINE);
    define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
    define('META_TAG_KEYWORDS', KEYWORDS . ' ' . NAVBAR_TITLE);
		break;
// 2P modified BOF - News & articles Management
  
  default:
  define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . PRIMARY_SECTION : '') . TITLE . TAGLINE);
  define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
  define('META_TAG_KEYWORDS', KEYWORDS . ' ' . NAVBAR_TITLE);
}
............................................................................................................................   

Optional Install  News Summary Module (HIGHLY RECOMENDED)
-----------------------------------------------------------
The main objective of this mod is capability to display more than one article
on the main index page, so this optional install is higly recomended.

1. For a fresh Zen Cart Install, copy file
     _optional_install/includes/templates/template_default/templates/tpl_index_default.php
   to your Zen Cart install.
2. For all other installs, open your Zen Cart file 
     includes/templates/template_default/templates/tpl_index_default.php
   and place the following code where you would like the news summary module to display:

<?php
// 2P modified BOF - News & Articles Management
/**
 * display News Summary
 */
  if (DISPLAY_NEWS_SUMMARY == 'true') {
    require($template->get_template_dir('tpl_modules_news_summary.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_news_summary.php');
  }
// 2P modified EOF - News & Articles Management
?>

    3. Go to Admin->Configuration->News & Articles Management and set proper values to
         Display News Summary 
         News Summary Articles Limit
         News Summary Cutoff Days

Optional Install - News Archive Sidebox
---------------------------------------
There is included News Archive Sidebox in this contribution package to install as option  

NOTE:
The original dreamscape's Sidebox Scroller and Sidebox Ticker are both buggy in Opera browser.
The Sidebox Scroller is buggy in most browsers (tested with IE, FireFox and Opera).
That's why I didn't included these nice sideboxes to this contribution.

News Archive Sidebox Install Notes
----------------------------------
    1. Copy all files to corresponding folders of your Zen Cart install.
    2. If you are using a template folder other than the default Zen Cart "classic" template folder,
       copy files from the classic template of this package (includes/templates/classic) to
       your custom template folder (includes/templates/your_template_folder)
    3. Setup placement of the new installed sidebox from
         Admin->Tools->Layout Boxes Controller
       The Box File Name is "sideboxes/news_archive.php".


