Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Article Manager v1.0


RobAnderson

Recommended Posts

Yesterday i had installed article manger as per your instructions. I got the following error for New articles and all articles. Please tell me how to correct these errors.

 

With Warm Regards,

Satish

[email protected]

 

 

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]

 

New Articles

 

All Articles

Current 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]

Link to comment
Share on other sites

Yesterday i had installed article manger as per your instructions. I got the following error for New articles and all articles. Please tell me how to correct these errors.

 

With Warm Regards,

Satish

[email protected]

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]

 

New Articles

 

All Articles

Current 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]

 

Do you install the sql file in your database??

Link to comment
Share on other sites

Well I've had no joy with WYSIWYG 1.7 or FCK so I've installed TinyMce onto my site.

 

How do I change the code

   $mce_str = YOURCODEHERE // Comma separated list of textarea names
// You can add more textareas to convert in the $mce_str, be careful that they are all separated by a comma.
 echo '<script language="javascript" type="text/javascript" src="includes/javascript/tiny_mce/tiny_mce.js"></script>';
 include "includes/javascript/tiny_mce/general.php";

 

for it to work?

Link to comment
Share on other sites

<?php
/*
 $Id: articles.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
*/

 function tep_show_topic($counter) {
global $tree, $topics_string, $tPath_array;

for ($i=0; $i<$tree[$counter]['level']; $i++) {
  $topics_string .= "  ";
}

$topics_string .= '<tr><TD valign="middle" height="20" align="left" style="padding-left:10px;"><img src="images/marker_cat.gif" width="3" height="5" alt="" style="margin-right:5px;" /><a class="categories" href="';

if ($tree[$counter]['parent'] == 0) {
  $tPath_new = 'tPath=' . $counter;
} else {
  $tPath_new = 'tPath=' . $tree[$counter]['path'];
}

$topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';

if (isset($tPath_array) && in_array($counter, $tPath_array)) {
  $topics_string .= '<b>';
}

// display topic name
$topics_string .= $tree[$counter]['name'];

if (isset($tPath_array) && in_array($counter, $tPath_array)) {
  $topics_string .= '</b>';
}

if (tep_has_topic_subtopics($counter)) {
  $topics_string .= ' ->';
}

$topics_string .= '</a>';

if (SHOW_ARTICLE_COUNTS == 'true') {
  $articles_in_topic = tep_count_articles_in_topic($counter);
  if ($articles_in_topic > 0) {
	$topics_string .= '<span class="categories"> (' . $articles_in_topic . ')';
  }
}

$topics_string .= '</td></tr><tr><td align="center"><img src="images/points_cat.gif" width="163" height="1"></td></tr>';

if ($tree[$counter]['next_id'] != false) {
  tep_show_topic($tree[$counter]['next_id']);
}
 }
?>
<!-- topics //-->
	  <tr>
		<td bgcolor="#FFE3A6" valign="top">
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_ARTICLES);

 new infoBoxHeading($info_box_contents, true, true);

 $topics_string = '';
 $tree = array();

 $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '0' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
 while ($topics = tep_db_fetch_array($topics_query))  {
$tree[$topics['topics_id']] = array('name' => $topics['topics_name'],
									'parent' => $topics['parent_id'],
									'level' => 0,
									'path' => $topics['topics_id'],
									'next_id' => false);

if (isset($parent_id)) {
  $tree[$parent_id]['next_id'] = $topics['topics_id'];
}

$parent_id = $topics['topics_id'];

if (!isset($first_topic_element)) {
  $first_topic_element = $topics['topics_id'];
}
 }

 //------------------------
 if (tep_not_null($tPath)) {
$new_path = '';
reset($tPath_array);
while (list($key, $value) = each($tPath_array)) {
  unset($parent_id);
  unset($first_id);
  $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$value . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
  if (tep_db_num_rows($topics_query)) {
	$new_path .= $value;
	while ($row = tep_db_fetch_array($topics_query)) {
	  $tree[$row['topics_id']] = array('name' => $row['topics_name'],
									   'parent' => $row['parent_id'],
									   'level' => $key+1,
									   'path' => $new_path . '_' . $row['topics_id'],
									   'next_id' => false);

	  if (isset($parent_id)) {
		$tree[$parent_id]['next_id'] = $row['topics_id'];
	  }

	  $parent_id = $row['topics_id'];

	  if (!isset($first_id)) {
		$first_id = $row['topics_id'];
	  }

	  $last_id = $row['topics_id'];
	}
	$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
	$tree[$value]['next_id'] = $first_id;
	$new_path .= '_';
  } else {
	break;
  }
}
 }
 tep_show_topic($first_topic_element);

 $info_box_contents = array();
 $new_articles_string = '';
 $all_articles_string = '';


 $info_box_contents[] = array('text' => '<table border="0" cellpadding="0" cellspacing="0" height="100%"  width="100%" style="border:1px solid #EBAB10; border-width:0px 1px;">' .$new_articles_string . $all_articles_string . $topics_string.'</table>');

 new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- topics_eof //-->

Link to comment
Share on other sites

To get tinyMCE Anywhere contribution working with article manager, I have added this code in admin/articles.php:

 

<?php // START tinyMCE

$languages = tep_get_languages(); // Get all languages

$mce_str='';

if ($action == 'edit_topic') {

// Build list of textareas to convert

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

$mce_str.="topics_description[".$languages[$i]['id']."],";

}//end for each language

$mce_str = rtrim ($mce_str,","); // Removed the last comma from the string.

} elseif ($action == 'new_article') {

// Build list of textareas to convert

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

$mce_str.="articles_description[".$languages[$i]['id']."],";

}//end for each language

$mce_str = rtrim ($mce_str,","); // Removed the last comma from the string.

}

if ($mce_str<>'') { ?>

<script language="javascript" type="text/javascript" src="includes/javascript/tiny_mce/tiny_mce.js"></script>

<?php

include "includes/javascript/tiny_mce/general.php";

} // END tinyMCE?>

 

just before this line:

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

 

- Rigadin2

Link to comment
Share on other sites

Hi, I have been looking for general directions on updating an old install from v1.0 to the current version, 1.5. I only found instructions for updating from 1.4 to 1.5. I wonder if I should go for a complete new install? Thanks for any pointers!

Link to comment
Share on other sites

Mmmm, the point is that I want to use the contribution without having topics. and I find this to be impossible with my version of articles manager.

I just want to display articles. When adding articles in the admin section they only get displayed on the site if I put the articles in topics. Do I miss something? Do I neeed to upgrade to a new version?

Thanks!

Link to comment
Share on other sites

OK, so I have now upgraded to v1.5, took me a while but managed to not mess up anything :)

 

The bad news however is I still can not show articles without having them put into topics.

Now the description of the contribution clearly says:

Article Manager includes the following features:

 

- Articles can be stored in multi-leveled topics (use of topics optional)

 

Only it doesn't work for me. I have searched through all 37 pages of this thread and found one other member asking for the same thing but there didn't seem to be an answer.

 

So for now my workaround is to misuse the topic as articles, i.e. I write the article content and titles into the topic content and titles.

 

I would still appreciate very much if anybody could tell me if there is a solution to this.

Link to comment
Share on other sites

  • 2 weeks later...

Rob

 

Great contrib but ... I must have done something in the install or it is incompatable with one of the other contribs I have, cause when I tried to pull up the site page it came up blank and in the view source all I saw was the meta tag for version and the html tags and the body tags. I just rolled back to a previous version I had backed up.

 

I have OS MS 2.2, Separate Pricing Per customer contrib, french language contrib, exact payment contrib, dynamic menu contrib, login box contrib, Link Manager contrib, then the article manager which I since had to remove.

 

Because I had so many contribs I used a compare and merge software to move your changes to my files but it didn't work, any suggestions?

 

Thanks

Carrie

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?

Link to comment
Share on other sites

Hi

 

I've been using this contribution for a long time and now want to change the application, so I reinstalled the latest version. - I hate fck and want to keep using the wysiwyg editor I had before, but it is completely gone. When I disable fck in admin, I have no html editing functionality at all.

 

Can someone please help me. This is supposed to go live in 3 days and I still have around 100 articles to add and edit.

Link to comment
Share on other sites

Is there a way to define this sort or display order of articles. Today they show newest 1st but I would like to define the display order. Any Idea's

 

The only way is to add a sort order field in the database, modify the admin so you can set the sort order for each article and then modify the queries in catalog to use the sort order.

 

- Rigadin2

Link to comment
Share on other sites

Hi

 

I have scoured the forum and can find lots of requests for the same thing, but no responses. I am hoping that someone may actually have an answer by now. I want to display the full latest article within a specific topic on my index page and, on the main topic pages, display the latest full article for that topic.

 

Can someone please tell me how to do this or point me to another contribution that can do this. I chose article manager because of the auto "archiving" and browse features, but the full article display is critical.

 

Thanks for any help on this.

Link to comment
Share on other sites

Ok

 

I figured out a hack to get around what I need (using the top level contribution which is at least part of a fix) - can someone please tell me how I hide subcategories in the menu box? That would get me sorted out as a workaround.

Link to comment
Share on other sites

Hey all,

 

I've been working on a way to split articles into multiple pages. I noticed someone made a page splitter based on the amount of characters on each page. But I wanted to be able to control where the page splits using a delimiter. I came up with a working solution but it could probably still be tweaked. For now it only works in the catalog end, in admin it looks like one long page. It's really easy to install:

 

In /catalog/article_info.php

 

Replace: roughly line 120

<p><?php echo stripslashes($article_info['articles_description']); ?></p>

 

With:

<?php
$delimiter = '<pagebreak>';
$article_split_count = substr_count(stripslashes($article_info['articles_description']), $delimiter);
$article_page_count = ($article_split_count+1);

if (isset($HTTP_GET_VARS['page'])) {
$page = $HTTP_GET_VARS['page'];
} elseif (isset($HTTP_POST_VARS['page'])) {
 $page = $HTTP_POST_VARS['page'];
} else {
 $page = '';
}
if (empty($page) || !is_numeric($page)) $page = 1;

$article_pages_array = array();
$article_pages_array = split($delimiter, stripslashes($article_info['articles_description']), $article_page_count);
$article_page_text = $article_pages_array[($page-1)];
$article_pages_array = array();

// GET RESULT LINKS
$display_links_string = '';
//next button
if ($page > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), 'articles_id=' . $articles_id . '&page' . '=' . ($page-1)) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><u>' . PREVNEXT_BUTTON_PREV . '</u></a>  ';
//all pages - this could be better - ie max display results
for ($i=0, $n=$article_page_count; $i<$n; ++$i) {
if (($i+1) == $page) {
	$display_links_string .= '<b>' . ($i+1) . '</b> ';
} else {
	$display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), 'articles_id=' . $articles_id . '&page' . '=' . ($i+1)) . '" class="pageResults" title=" ' . $articles_name . TEXT_DISPLAY_ARTICLE_PAGE . ' ' . ($i+1) . ' "><u>' . ($i+1) . '</u></a> ';
}
}
//previous button
if (($page < $article_page_count) && ($article_page_count != 1)) $display_links_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), 'articles_id=' . $articles_id . '&page=' . ($page+1)) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' "><u>' . PREVNEXT_BUTTON_NEXT . '</u></a> ';

// PRINT PAGE TEXT
$continued_text = '';
if (($page < $article_page_count) && ($article_page_count != 1)) $continued_text = '</p><p align="right">' . TEXT_DISPLAY_ARTICLE_PAGE_CONTINUED . '  ';
echo '<p>' . $article_page_text . $continued_text . '</p>';
?>

 

And then right before this: roughly line 128

		</td>
  </tr>
<?php
if (tep_not_null($article_info['articles_url'])) {
?>

 

Add this:

<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
<td class="smallText"><?php echo sprintf(TEXT_DISPLAY_NUMBER_OF_ARTICLE_PAGES, $page, $article_page_count, $article_page_count); ?></td>
<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $display_links_string; ?></td>
 </tr>
 <tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 </tr>
</table>

 

And add the following the your language file (ie /catalog/includes/languages/english.php) where the rest of the article manager code is located or before the last "?>":

define('TEXT_DISPLAY_NUMBER_OF_ARTICLE_PAGES', 'Displaying <b>%d</b> of <b>%d</b> (of <b>%d</b> pages)');
define('TEXT_DISPLAY_ARTICLE_PAGE', 'Page');
define('TEXT_DISPLAY_ARTICLE_PAGE_CONTINUED', '<b>Continued...</b>');

 

That's it. Now when I write an article, i place a "<pagebreak>" (w/o quotes) in the body of the article to split it.

 

For instance:

 

This text is on page 1

<pagebreak>

This text is on page 2

<pagebreak>

This text is on page 3

 

As it stands now, it displays all of the pages in the results: ie [<< Prev] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [Next >>]

 

I couldn't figure out how to implement the max links per page like the one used for product/article listings. ie [<< Prev] 1 2 3 4 5 ... [Next >>]

 

Other than that it works good. I am using Ultimate SEO URLS, I havn't tried it without SEO URLS but it should still work. If someone knows how to utilize the max links per page "...", I would be very interested to see how. :)

 

Later

Link to comment
Share on other sites

Rob, do u have this running somewhere mate, so I can have a peek?

 

we have just installed it and find it a great contribution. The only regret is that we should have installed earlier.

 

you may have a peek at our site. http://www.movingtee.com/article_info.php?articles_id=8 we have also implement the cross sell function. It is just superb!!

 

Thank you for your author for this great contribution

Link to comment
Share on other sites

Hi,

I also installed Article Manager in many osC, but now i'm stucked because I have STS installed and I need a placeholder.

It's someone clever enough to illuminate me, pls?

How I do to make visible on my index the Articles?

 

Thks,

Mugur

Link to comment
Share on other sites

Hi,

I also installed Article Manager in many osC, but now i'm stucked because I have STS installed and I need a placeholder.

It's someone clever enough to illuminate me, pls?

How I do to make visible on my index the Articles?

 

Thks,

Mugur

Link to comment
Share on other sites

The STS file includes/modules/sts_inc/sts_user_code.php contains an example of creation of placeholder for an infobox. It should be clear enough. If not, you can ask help in the STS forum.

 

- Chris "Rigadin2"

Link to comment
Share on other sites

I have installed this contribution numerous times in the past and now for whatever reason it just isn't working - all of the data is posting correctly to the database, the details are correct ie Displaying 1 of 10 articles - however only the last article shows on any of the article pages - whether it is the new articles, all articles, a particular category - only 1 article displays and it is only the last one entered .... any idea on where to start looking?

 

thanks!

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

Get the following error in article.php

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX_ARTICLES_PER_PAGE' at line 1

select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id from articles_to_topics a2t left join articles a on (a.articles_id=a2t.articles_id) left join articles_description ad on (a.articles_id=ad.articles_id) left join authors au on a.authors_id = au.authors_id left join topics_description td on a2t.topics_id = td.topics_id where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_status = '1' and au.authors_id = '1' and ad.language_id = '4' and td.language_id = '4' order by a.articles_date_added desc, ad.articles_name limit 0, MAX_ARTICLES_PER_PAGE

 

can't find this code in the source, any suggestion or solution welcome.

 

using mysql v5

 

thanks,

Ruud

Link to comment
Share on other sites

Hi,

 

Get the following error in article.php

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX_ARTICLES_PER_PAGE' at line 1

select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id from articles_to_topics a2t left join articles a on (a.articles_id=a2t.articles_id) left join articles_description ad on (a.articles_id=ad.articles_id) left join authors au on a.authors_id = au.authors_id left join topics_description td on a2t.topics_id = td.topics_id where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_status = '1' and au.authors_id = '1' and ad.language_id = '4' and td.language_id = '4' order by a.articles_date_added desc, ad.articles_name limit 0, MAX_ARTICLES_PER_PAGE

 

can't find this code in the source, any suggestion or solution welcome.

 

using mysql v5

 

thanks,

Ruud

Link to comment
Share on other sites

There are a couple places where this contrib hickups with msql5. I don't remember exactly which files needed it, but I know /catalog/articles_new.php needed it for certain.

 

This is the original query from articles_new.php

$listing_sql = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_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 = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY) order by a.articles_date_added desc, ad.articles_name";

 

And this is what I replaced it with:

$listing_sql = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t) left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_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 = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY) order by a.articles_date_added desc, ad.articles_name";

 

Basically the only difference is that the tables between "from" and "left join" had to be encased with parentheses.

 

from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t) left join

 

It was on a few other pages also. Just look for "left joins" in the article files and add the parentheses. After that it played nice with MYSQL5.

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...