Jump to content



Latest News: (loading..)

- - - - -

News Archive


  • Please log in to reply
1 reply to this topic

#1   kenkja

kenkja
  • Members
  • 242 posts
  • Real Name:Ken Johnson
  • Gender:Male
  • Location:Uk, Yorkshire

Posted 16 July 2012 - 11:33 AM

Hi All,

I'm trying to create a series of news archive for press realeases sent out by a number of manufacturers

I use v2.3.1 with a number of add ons, including document manager, some files from which I have used to try to create the archive, my documents manager is not as the add on should be, but all should become clear.

I added to includes/modules/boxes/bm_information.php, the appropriate lines to show the news archive within the info box, added the definitions to filenames.php and used from document manager catalog/documents.php and catalog/includes/languages/english/documents.php to create news_archive.php in the appropriate directories

No problem all worked as it should do.

But, my plan was to have the news_archive.php to show a list of news items, which when clicked bought up that news page, that where I lost the plot.

What I tried to do was use the same 2 files, to create the news_item.php files, effectively in my plan every news-item would have its own news_item.php files, and every time I add a news item I would add a link to it in the news_archive.php file.

So I now have, news_archive.php and news_item.php in the catalog folder as follows, but with the filename definitions changed as appropriate

<?php
/*
  $Id$
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2010 osCommerce
  Released under the GNU General Public License
*/
  require('includes/application_top.php');
  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEWS_ARCHIVE);
  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_NEWS_ARCHIVE));
  require(DIR_WS_INCLUDES . 'template_top.php');
?>
<h1><?php echo HEADING_TITLE; ?></h1>
<div class="contentContainer">
  <div class="contentText">
	<?php echo TEXT_INFORMATION; ?>
  </div>
  <div class="buttonSet">
	<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?></span>
  </div>
</div>
<?php
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Then in catalog/includes/languages/english/news_archive.php

<?php
/*
  $Id$
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2002 osCommerce
  Released under the GNU General Public License
*/

define('NAVBAR_TITLE', 'News Archive');
define('HEADING_TITLE', 'News Archive');
define('TEXT_INFORMATION', '
<a href="http://mysite/news_item.php" target="blank"><font color="#ff0000"> Italian Enduro Championship</a>&nbsp&nbsp

');
?>

Then the news-item.php

<?php
/*
  $Id$
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2002 osCommerce
  Released under the GNU General Public License
*/
define('NAVBAR_TITLE', 'News Item');
define('HEADING_TITLE', 'News Item');
define('TEXT_INFORMATION', 'The Italian Enduro championship, .....

');
?>

After clicking the News Archive line in the info box, catalog/includes/languages/english/news_archive.php, is displayed exactly as required, but the link to the news_item.php just displays index.php.

I'm aware that the hyperlink code is probably not the best way to do this, but don't know how it should be done and also it seems as though the catalog/includes/languages/english/news_archive.php should somehow be a combination of itself and the catalog/news_archive.php, as it is now or at least is trying to be a stepping stone to another file, rather than the end result as it was orginally intended.


Also aware that it would be better if there was just one news_item page and that the database should hold the info on the different news items, but preet clueless as to how to do that

Any clues would be gratefully received.

thanks

Ken

Edited by kenkja, 16 July 2012 - 11:36 AM.

Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags
Ultimate SEO Urls Pro

#2   kenkja

kenkja
  • Members
  • 242 posts
  • Real Name:Ken Johnson
  • Gender:Male
  • Location:Uk, Yorkshire

Posted 17 July 2012 - 05:02 AM

Decided to take the easy way out and make each news item, a pdf, so need for any help on above, thanks

ken
Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags
Ultimate SEO Urls Pro