Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Article Manager v1.0


RobAnderson

Recommended Posts

If articles are displayed in the infobox, but not when clicking the corresponding link, there is a problem with the query in article_info.php and v1.5 should solve it. This is for example the case when there is no author defined for an article.

 

The xsell from article to product is a box that appears in article_info.php, this box can be found in includes/modules/articles_xsell.php and this file has not been modified since 2003. You should investigate in this file to see why nothing is shown.

 

- Rigadin

Link to comment
Share on other sites

Hi rigadin

 

The articles_xsell.php is identical with your version? I used WinMerged to compare most of yours/my files - and it seemed there were no differencies??

There is also an author attached to the article!

 

This is my article_info.php page

 

<?php
/*
 $Id: article_info.php, v1.0 2003/12/04 12:00:00 ra Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ARTICLE_INFO);

 $article_check_query = tep_db_query("SELECT COUNT(*) as total from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_status = '1' and a.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and ad.articles_id = a.articles_id and ad.language_id = '" . (int)$languages_id . "'");
 $article_check = tep_db_fetch_array($article_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
// BOF: Header Tag Controller v2.6.0
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE; ?></title>
<?php
}
// EOF: Header Tag Controller v2.6.0
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
</head>
<body>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
 if ($article_check['total'] < 1) {
?>
  <tr>
	<td class="pageHeading" ><?php echo HEADING_ARTICLE_NOT_FOUND; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main" ><?php echo TEXT_ARTICLE_NOT_FOUND; ?></td>
  </tr>
<?php
 } else {
$article_info_query = tep_db_query("select a.articles_id, a.articles_date_added, a.articles_date_available, a.authors_id, ad.articles_name, ad.articles_description, ad.articles_url, au.authors_name from " . TABLE_ARTICLES . " a left join " . TABLE_AUTHORS . " au using(authors_id), " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_status = '1' and a.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and ad.articles_id = a.articles_id and ad.language_id = '" . (int)$languages_id . "'");
$article_info = tep_db_fetch_array($article_info_query);

tep_db_query("update " . TABLE_ARTICLES_DESCRIPTION . " set articles_viewed = articles_viewed+1 where articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and language_id = '" . (int)$languages_id . "'");

$articles_name = $article_info['articles_name'];
$articles_author_id = $article_info['authors_id'];
$articles_author = $article_info['authors_name'];
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading" valign="bottom"><?php echo $articles_name; ?></td>
		 <td class="main" align="right" valign="bottom">
		 <?php
		 if (tep_not_null($articles_author) && DISPLAY_AUTHOR_ARTICLE_LISTING == 'true') echo TEXT_BY . '<a href="' . tep_href_link(FILENAME_ARTICLES,'authors_id=' . $articles_author_id) . '">' . $articles_author . '</a>';
		 ?>
		 </td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main">
	  <p><?php echo stripslashes($article_info['articles_description']); ?></p>
	</td>
  </tr>
<?php
if (tep_not_null($article_info['articles_url'])) {
?>
  <tr>
	<td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($article_info['articles_url']), 'NONSSL', true, false)); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
}
if (DISPLAY_DATE_ADDED_ARTICLE_LISTING == 'true') {
if ($article_info['articles_date_available'] > date('Y-m-d H:i:s')) {
?>
  <tr>
	<td align="left" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($article_info['articles_date_available'])); ?></td>
  </tr>
<?php
} else {
?>
  <tr>
	<td align="left" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($article_info['articles_date_added'])); ?></td>
  </tr>
<?php
}
}
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php  if (ENABLE_ARTICLE_REVIEWS == 'true') {
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_ARTICLE_REVIEWS . " r, ". TABLE_ARTICLE_REVIEWS_DESCRIPTION . " rd where r.approved = 1 and r.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "'");	
$reviews = tep_db_fetch_array($reviews_query);
?>
  <tr>
	<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
  </tr>
<?php
if ($reviews['count'] <= 0) {
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS_WRITE, tep_get_all_get_params()) . '">' . tep_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
  </tr>
<?php
} else {
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS_WRITE, tep_get_all_get_params()) . '">' . tep_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a> '; ?><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
  </tr>
<?php
}
 }
?>
  </tr></form>
<!-- tell_a_friend //-->
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
	  <tr>
		<td>
<?php
 if (ENABLE_TELL_A_FRIEND_ARTICLE == 'true') {
if (isset($HTTP_GET_VARS['articles_id'])) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => BOX_TEXT_TELL_A_FRIEND);

  new infoBoxHeading($info_box_contents, true, true);

  $info_box_contents = array();
  $info_box_contents[] = array('form' => tep_draw_form('tell_a_friend', tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get'),
							   'align' => 'left',
							   'text' => TEXT_TELL_A_FRIEND . ' ' . tep_draw_input_field('to_email_address', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . tep_draw_hidden_field('articles_id', $HTTP_GET_VARS['articles_id']) . tep_hide_session_id() );

  new infoBox($info_box_contents);
}
 }
?>
		</td>
	  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>		  
<!-- tell_a_friend_eof //-->
  <tr>
	<td>
<?php
//added for cross-sell
  if ( (USE_CACHE == 'true') && !SID) {
 include(DIR_WS_MODULES . FILENAME_ARTICLES_XSELL);
  } else {
 include(DIR_WS_MODULES . FILENAME_ARTICLES_XSELL);
}
  }
?>
	<?php echo '<a href="' . tep_href_link(FILENAME_ARTICLES, tep_get_all_get_params()) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
  </tr>
  </table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

hello,

 

looks like a GREAT contrib.

;-)

 

i have installed latest version ( v1.5 with admin )

 

after activation STS 4.3 i got this error

 

Fatal error: Cannot redeclare clean_html_comments() (previously declared in I:\www.roh-shop.de\includes\functions\clean_html_comments.php:11) in I:\www.roh-shop.de\includes\functions\clean_html_comments.php on line 11

 

 

anyone knows what i have do wrong ?

 

 

thanks in advance.

 

bg

michael

Link to comment
Share on other sites

Fatal error: Cannot redeclare clean_html_comments() (previously declared in I:\www.roh-shop.de\includes\functions\clean_html_comments.php:11) in I:\www.roh-shop.de\includes\functions\clean_html_comments.php on line 11

 

hello,

 

sorry, i have made a mistake.

i do not read the "not" in the this install-instructions:

 

"add only if Header Tags not already installed"

 

i delete this lines and the problem is gone.

 

bg

Michael

Link to comment
Share on other sites

I have installed Article Manager 1.5.

Seems to be working fine so far. But there is one thing I would like to change:

 

When you view the articles page, the author and topic links are not in the correct order.

Here is how it appears:

Looking at Depression Differently by Dr. Gregg Topic: Depression

Jantz

 

It should appear like this:

Looking at Depression Differently by Dr. Gregg Jantz

Topic: Depression

 

It appears the code that needs to be changed is in articles_listing.php.

How can I change this to make the above?

<?php // osc-help.net: added class=main to the link.

echo '<a class="main" href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $articles_listing['articles_id']) . '"><b>' . $articles_listing['articles_name'] . '</b></a> ';

if (DISPLAY_AUTHOR_ARTICLE_LISTING == 'true' && tep_not_null($articles_listing['authors_name'])) {

echo TEXT_BY . ' ' . '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $articles_listing['authors_id']) . '"> ' . $articles_listing['authors_name'] . '</a>';

}

?>

</td>

<?php

if (DISPLAY_TOPIC_ARTICLE_LISTING == 'true' && tep_not_null($articles_listing['topics_name'])) {

?>

<td valign="top" class="main" width="25%" nowrap><?php echo TEXT_TOPIC . ' <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $articles_listing['topics_id']) . '">' . $articles_listing['topics_name'] . '</a>'; ?></td>

<?php

}

?>

</tr>

Link to comment
Share on other sites

Tell a Friend feature

 

I have installed the Tell a Friend for Non-Product Contrib. Does anyone else have this contrib installed and edited the php file so that it will work with the Article Manager Tell a Friend?

 

If so, can ypu post the edits that you did to make both contribs work?

Link to comment
Share on other sites

I have installed Article Manager 1.5.

Seems to be working fine so far. But there is one thing I would like to change:

 

When you view the articles page, the author and topic links are not in the correct order.

Here is how it appears:

It should appear like this:

It appears the code that needs to be changed is in articles_listing.php.

How can I change this to make the above?

After posting another article, it appears that the position of the entire link for the author is determined by how long the article title is. Is there a way to just force the title and author link to be on one line and the topic to be on a second line?

Link to comment
Share on other sites

hi, i have installed this contrib on my site and everything seems to be working ok.

 

the only problem i have with it is that it is displayed different on firefox and IE.

 

it works perfect in firefox but ALL of the text on the page is centered in IE. very annoying!

 

here is a link to my shop: http://www.mytrainingspecialist.com/catalog/articles.php

 

 

*NOTE the site is still in its development stages.

Link to comment
Share on other sites

I have installed Article Manager 1.5.

Seems to be working fine so far. But there is one thing I would like to change:

 

When you view the articles page, the author and topic links are not in the correct order.

Here is how it appears:

It should appear like this:

It appears the code that needs to be changed is in articles_listing.php.

How can I change this to make the above?

 

After posting another article, it appears that the position of the entire link for the author is determined by how long the article title is. Is there a way to just force the title and author link to be on one line and the topic to be on a second line?

Any answer on this?

Link to comment
Share on other sites

- The search feature has not changed from v1.4 to v1.5

- For now there is no option to limit the display of articles only to logged in users

 

 

Rigadin

Link to comment
Share on other sites

Tell a Friend feature

 

I have installed the Tell a Friend for Non-Product Contrib. Does anyone else have this contrib installed and edited the php file so that it will work with the Article Manager Tell a Friend?

 

If so, can ypu post the edits that you did to make both contribs work?

Any answer on this?

Link to comment
Share on other sites

Hi,

 

I just installed the Latest 1.5 with Admin. Havent used article manager in a while but I get this problem when I go to view all articles,

 

1054 - Unknown column 'a.authors_id' in 'on clause'

 

select count(*) as total from articles a, articles_to_topics a2t left join topics_description td on a2t.topics_id = td.topics_id left join authors au on a.authors_id = au.authors_id, articles_description ad where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '1' and td.language_id = '1'

 

[TEP STOP]

 

And then This problem when I go to view new articles

 

1054 - Unknown column 'a.authors_id' in 'on clause'

 

select count(*) as total from articles a, articles_to_topics a2t left join topics_description td on a2t.topics_id = td.topics_id left join authors au on a.authors_id = au.authors_id, articles_description ad where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '1' and td.language_id = '1' and a.articles_date_added > SUBDATE(now( ), INTERVAL '30' DAY)

 

[TEP STOP]

 

However when I click on an Authors name the list of their articles does indeed show up.

 

Can Someone help me with this one.

 

Thanks,

 

Kris

Don't die with the music in you!!!

 

Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...

Link to comment
Share on other sites

Think I found a small bug *or maybe I'm the 'bug* *lol*

 

When in Danish, the top bar, breadcrum, changes language in the 4' link....

 

Forside » Butik » Produkt artikler » A Tiny Book about "Matador"

 

It should be in Danish all the way like:

Forside » Butik » Produkt artikler » En lille bog om "Matador"

 

This is the english version (just to show you) which works fine

Top » Catalog » Product articles » A Tiny Book about "Matador"

 

is it me - or is something missing in the translation code?

 

Helle :-)

Link to comment
Share on other sites

Hi,

 

I have installesd this GRRRRRRRRRRRReat contribution, one of the things <that i dont know the answer for...> is that it shows only the articles that have a topic "above" them. meaning that direct post articles (those without any topics; the link to the <b> article</b> itself should be in the in the article box> are not showing there.

 

my guess is its a simple thing that i cant find. . .

 

Thanks a lot,

 

Sharon.

Installed contributions:

Ultimate_SEO, Article Manager 1.5, Dynamic SiteMap 2.0, Infopages, Google SiteMap XMl w/admin 2.1, HeaderTagControler 2.6.1, FCKosc 2.21, X-sell 2.3, Google Analytics Modul, All Products, Page Cache 1.5, EasyPopulate2.7d, Multi Product Manager 2.5, Define Main Page, and probably few others...

Link to comment
Share on other sites

I have installed Article Manager 1.5.

Seems to be working fine so far. But there is one thing I would like to change:

When you view the articles page, the author and topic links are not in the correct order.

Here is how it appears:

Looking at Depression Differently by Dr. Gregg Topic: Depression

Jantz

 

It should appear like this:

 

Looking at Depression Differently by Dr. Gregg Jantz

Topic: Depression

 

It appears the code that needs to be changed is in articles_listing.php.

After posting another article, it appears that the position of the entire link for the author is determined by how long the article title is. Is there a way to just force the title and author link to be on one line and the topic to be on a second line?

 

Anyone know what needs to be changed in this code

<?php // osc-help.net: added class=main to the link.

echo '<a class="main" href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $articles_listing['articles_id']) . '"><b>' . $articles_listing['articles_name'] . '</b></a> ';

if (DISPLAY_AUTHOR_ARTICLE_LISTING == 'true' && tep_not_null($articles_listing['authors_name'])) {

echo TEXT_BY . ' ' . '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $articles_listing['authors_id']) . '"> ' . $articles_listing['authors_name'] . '</a>';

}

?>

</td>

<?php

if (DISPLAY_TOPIC_ARTICLE_LISTING == 'true' && tep_not_null($articles_listing['topics_name'])) {

?>

<td valign="top" class="main" width="25%" nowrap><?php echo TEXT_TOPIC . ' <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $articles_listing['topics_id']) . '">' . $articles_listing['topics_name'] . '</a>'; ?></td>

<?php

}

?>

</tr>

Link to comment
Share on other sites

Hi,

 

I have installesd this GRRRRRRRRRRRReat contribution, one of the things <that i dont know the answer for...> is that it shows only the articles that have a topic "above" them. meaning that direct post articles (those without any topics; the link to the <b> article</b> itself should be in the in the article box> are not showing there.

 

my guess is its a simple thing that i cant find. . .

 

Thanks a lot,

 

Sharon.

 

 

Yes. I just found this problem too. If the articles under the "top", i.e. without a topic, they will not be shown. However the article count seems to be right!

Link to comment
Share on other sites

After posting another article, it appears that the position of the entire link for the author is determined by how long the article title is. Is there a way to just force the title and author link to be on one line and the topic to be on a second line?

 

Anyone know what needs to be changed in this code

Any answer to this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...