Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Article Manager v1.0


RobAnderson

Recommended Posts

I'v installed Article Manager v1.5 as instructed, but when I click on Cross-Sell Articles I get this message.

What went wrong.

 

 

if (!$add_related_article_ID) if (!$add_related_article_ID) if ($_POST && !$sort) { if ($_POST[run_update]==true) { $query ="DELETE FROM " . TABLE_ARTICLES_XSELL . " WHERE articles_id = '".$_POST[add_related_article_ID]."'"; if (!tep_db_query($query)) exit(TEXT_NO_DELETE); } if ($_POST[xsell_id]) foreach ($_POST[xsell_id] as $temp) { $query = "INSERT INTO " . TABLE_ARTICLES_XSELL . " VALUES ('',$_POST[add_related_article_ID],$temp,1)"; if (!tep_db_query($query)) exit(TEXT_NO_INSERT); } ?>

Link to comment
Share on other sites

Hi again!

 

In the article listing page the "read more" links are missing at the end of the lead! :(

the "..." is in place, but not followed the "read more" link ...:(

 

you can see here:

 

http://joker.neuronet.hu/hypernet/catalog/...les.php?tPath=1

 

(should followed after "...Phil Hester, az AMD ..." in the lead)

 

plz help!

 

thanks!

Link to comment
Share on other sites

  • 2 weeks later...
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'

 

Me too! The 1054 error is to do with mySQL 5.0.12 I've been looking at the sql statements and can't get my head around the changes needed, for one thing the $listing_sql values don't match the ones in the other thread I found on this subject!! Does anyone have Article Manager 1.5 working with MySQL 5.0.12 or later?? Could you post here or pm your catalog/articles.php and catalog/articles_new.php so that I can see what's going on?

Link to comment
Share on other sites

In queries where you find:

 

on a.authors_id = au.authors_id

 

Replace by:

 

using(authors_id)

 

And it should work

 

I had the same problem with php5 installed. the above fix didnt work, and i had a similar issue with another mod, so i thought id try and give it a go

 

Anyways I tried the fix from the other mod and it seems to be working, in articles.php in the various table outputs it has a query listing (if my terminology here sucks then sorry), this is the bit makes the all articles work, going to find the rest in a mo :)

 

find

 

$articles_all_query_raw = "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 . "' order by a.articles_date_added desc, ad.articles_name";

 

change to

 

$articles_all_query_raw = "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 . "' order by a.articles_date_added desc, ad.articles_name";

 

 

notice the from ((" . TABLE_ARTICLES . " a), " . TABLE_ARTICLES_TO_TOPICS . " a2t) is changed, cant remember the reason for this, hope this solves some issues

Link to comment
Share on other sites

Ok part 2 :)

 

find in 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";

 

Change to

 

 

$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";

 

this is the same fix as before, just been slightly renamed

 

Hope this helps lots of people :)

Edited by kevicho
Link to comment
Share on other sites

Ok part 2 :)

 

find in 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";

 

Change to

$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";

 

this is the same fix as before, just been slightly renamed

 

Hope this helps lots of people :)

 

 

Just a note, i think that fix is backwards compatible, might be worth checking for future releases :)

Edited by kevicho
Link to comment
Share on other sites

Is Article Manager 1.5 compatible with PHP5/MySQL5 ? In attempting to run the SQL file supplied I get the following error:

 

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function )

VALUES (

'', 'Display New Articles Link', 'DISPLAY_NEW_ARTICLES', 'true', 'Display a link to New Articles in the Articles box?', 456, 1, now( ) , now( ) , NULL , 'tep_cfg_select_option(array(\'true\', \'false\'),'

)

 

 

#1264 - Out of range value adjusted for column 'configuration_id' at row 1

 

I would be very grateful if anyone can help with this.

Link to comment
Share on other sites

Is Article Manager 1.5 compatible with PHP5/MySQL5 ? In attempting to run the SQL file supplied I get the following error:

 

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function )

VALUES (

'', 'Display New Articles Link', 'DISPLAY_NEW_ARTICLES', 'true', 'Display a link to New Articles in the Articles box?', 456, 1, now( ) , now( ) , NULL , 'tep_cfg_select_option(array(\'true\', \'false\'),'

)

#1264 - Out of range value adjusted for column 'configuration_id' at row 1

 

I would be very grateful if anyone can help with this.

 

Maybe a typo there, but is there a ; after your last ) ???

Link to comment
Share on other sites

OK so I got articles manager working great on a clean install of oscommerce. I applied it to the test version of my real site which has several contributions installed already, including HTC. And it's all working great *except* for this one thing. I'm not sure if it's a HTC thing or a tinyMCE thing but when I select an individual article it seems to be adding the meta tags to the body instead of the head of the file. There's no difference between the articles.php files for each version of oscommerce.

 

vanilla.gif

 

testsite.gif

 

Anyone got an idea where this comes from?

Edited by trogette
Link to comment
Share on other sites

TinyMCE is only an editor for the article description, it has no effect on where the things are placed on the page.

 

With each article you define the text of the article as well as a short description to be used in article listing but also on article page. This short description is, as far as I remember, also used for the description tag in HTC. So what you have would be a feature, not a problem.

 

Not 100% sure, the only way is to check the code.

 

- Rigadin

Link to comment
Share on other sites

thanks, but which bit of code?? LOL Like I said, the articles.php files are the same, as are the articles_header_tags.php files. I'd love for it to be properly in the meta tags :) Not sure if it's obvious there that the first pic is the vanilla version and the second is the test version, with the offending text at the top.

Link to comment
Share on other sites

thanks, but which bit of code?? LOL Like I said, the articles.php files are the same, as are the articles_header_tags.php files. I'd love for it to be properly in the meta tags :) Not sure if it's obvious there that the first pic is the vanilla version and the second is the test version, with the offending text at the top.

 

I had a similar problem with this once on an older site i worked on, it turned out the admin input for the product description was overwritten by some code for a different input (cant remember exactly what now), so my admin side was saying product but outputting to something else (if you get what i mean lol)

 

Might be worth going through the admin side of the install again, also might be worth using something like examdiff to check that theres nothing glaringly obvious between your test and pre live site (i hope this update wasnt put on your live live site lol) :)

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

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?

 

Im going to post my article listing which now appears in columns of threes and i think is the same as yours

 

Also beware i dont use one or two of the items that can be listable.

 

Maybe this is considered scruffy code but i was pleased :D

Link to comment
Share on other sites

Includes/modules/article_listing.php

 

This makes the articles appear in rows of 3

 

Change the if ($col==3) { bit to whatever number you want

 

<?php

/*

$Id: article_listing.php, v1.0 2003/12/04 12:00:00 ra Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

$listing_split = new splitPageResults($listing_sql, MAX_ARTICLES_PER_PAGE);

if (($listing_split->number_of_rows > 0) && ((ARTICLE_PREV_NEXT_BAR_LOCATION == 'top') || (ARTICLE_PREV_NEXT_BAR_LOCATION == 'both'))) {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_ARTICLES); ?></td>

<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

</table></td>

</tr>

<?php

}

?>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="4"><tr>

<?php

$col=0;

if ($listing_split->number_of_rows > 0) {

$articles_listing_query = tep_db_query($listing_split->sql_query);

 

?>

<td class="main" colspan=3><?php echo TEXT_ARTICLES; ?></td>

</tr><tr>

 

<?php

while ($articles_listing = tep_db_fetch_array($articles_listing_query)) {

?>

<td><table border=0><tr><td>

<?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></tr><tr>

<?php

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

?>

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

<?php

}

?>

 

<?php

$col++;

if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true') {

?>

 

<br><?php echo clean_html_comments(substr($articles_listing['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_listing['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>

</tr></table></td>

 

 

<?php

}

if (DISPLAY_DATE_ADDED_ARTICLE_LISTING == 'true') {

?>

<tr>

<td class="smalltext" style="padding-left:15px"><?php echo TEXT_DATE_ADDED . ' ' . tep_date_long($articles_listing['articles_date_added']); ?></td>

</tr>

<?php

}

if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true' || DISPLAY_DATE_ADDED_ARTICLE_LISTING) {

?>

 

<?php

if ($col==3) {

?>

 

</tr><tr>

<?php

$col=0;

}

?>

 

<?php

}

} // End of listing loop

} else {

?>

<tr>

<td class="main"><?php if ($listing_no_article<>'') {

echo $listing_no_article;

} elseif ($topic_depth == 'articles') {

echo TEXT_NO_ARTICLES;

} elseif (isset($HTTP_GET_VARS['authors_id'])) {

echo TEXT_NO_ARTICLES2;

} ?></td>

</tr>

 

}

}

<?php

}

?>

</tr></table></td></tr>

 

<?php

if (($listing_split->number_of_rows > 0) && ((ARTICLE_PREV_NEXT_BAR_LOCATION == 'bottom') || (ARTICLE_PREV_NEXT_BAR_LOCATION == 'both'))) {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_ARTICLES); ?></td>

<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

</table></td>

</tr>

<?php

}

?>

Link to comment
Share on other sites

Includes/modules/article_listing.php

 

This makes the articles appear in rows of 3

 

Change the if ($col==3) { bit to whatever number you want

 

 

Does anyone know how i can get the article infoboxes to only appear on the article pages (ie all articles, new arcles and article info etc) ???

Link to comment
Share on other sites

Does anyone know how i can get the article infoboxes to only appear on the article pages (ie all articles, new arcles and article info etc) ???

 

It'll be something like the code for the language and currency boxes to disappear on the checkout pages which is this:

 

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
include(DIR_WS_BOXES . 'languages.php');
include(DIR_WS_BOXES . 'currencies.php');

 

in whichever column file you want your articles box to appear in. I'm just going to add the link to articles.php in my existing information infobox, and possibly to the header nav too.

Link to comment
Share on other sites

Is Article Manager 1.5 compatible with PHP5/MySQL5 ? In attempting to run the SQL file supplied I get the following error:

 

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function )

VALUES (

'', 'Display New Articles Link', 'DISPLAY_NEW_ARTICLES', 'true', 'Display a link to New Articles in the Articles box?', 456, 1, now( ) , now( ) , NULL , 'tep_cfg_select_option(array(\'true\', \'false\'),'

)

#1264 - Out of range value adjusted for column 'configuration_id' at row 1

 

I would be very grateful if anyone can help with this.

 

I think I have found the answer here. It appears to be related to the fact that MySQL 5 requires an integer in the Integer field! - in this case configuration_id. This means that when it hits the [VALUES ('', 'Display New Articles Link', etc] part of the INSERT statement an error is generated because the way of specifying a default entry with the two apostrophes [('',] is no longer valid - even for auto-increment fields.

 

Well, if it wants an integer - give it one. Just check the last configuration_id number used in the configuration table and then load the next numbers into VALUES, incrementing as you go.

 

e.g.

 

VALUES ('143', 'Display New Articles Link', etc ...

VALUES ('144', 'Number of Days Display New Articles', etc ...

VALUES ('145', 'Maximum New Articles Per Page', etc ...

 

It worked for me.

 

Another problem my syntax highlighter picked up was on line 14 of the SQL file:

 

'The maximum length of the author\'s name for display in the Author box',

 

The apostrophe in author\'s, even though it was preceded by a backslash caused problems.

 

I removed the backslash and the apostrophe and all was forgiven :P

 

Please note that this is clearly a work-around. It would be much better if there was someone out there who could come up with the correct MySQL 5 syntax for handling an auto-increment field rather than manually inserting values.

 

In the mean time I hope this helps.

Link to comment
Share on other sites

hi, i have installed the article manager. and on page: http://localhost/osc/articles_new.php i got this error:

 

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 'NEW_ARTICLES_DAYS_DISPLAY' DAY)

 

can you tell me where the sql is and how i can fix it?

 

thanks.

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