Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Article Manager v1.0


RobAnderson

Recommended Posts

Little image hack

This "contrib" allows you to attach heading images to the articles listing.

 

Sorry, I forgot explain the image names, so

article:

/article_info.php/articles_id/1

Image

/images/magazin-1.jpg

 

article:

/article_info.php/articles_id/2

Image

/images/magazin-2.jpg

 

etc

working demo:

http://www.anrodiszlec.hu/articles.php/tPath/1

 

 

Hi, I have downloaded your article_listing contribution

but I don't know where the file goes. Its not part of the main package (v1.51) that I can find. Do I drop that file in the root (catalog/) and what calls it. then how do you add an image and link it to an article. It works fantastic on your site.

 

Also -- Does anbody know how I kill the center thing that happens --- All the main Article pages makes everything CENTERED on the rest of the page.

Not flush left -- I want to take away this centering issue - just can't find it.

 

Thanks in advance!! :thumbsup:

Music is body splash for the soul.

Link to comment
Share on other sites

When I run the v1.5 sql script I get the following error.

 

SQL query: Documentation

 

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\'),'

);

 

MySQL said: Documentation

#1366 - Incorrect integer value: '' for column 'configuration_id' at row 1

 

I am running mysql 5.

 

The configuration_id field is set to auto-increment.

 

any help will be greatly appreciated

Link to comment
Share on other sites

I'M ALSO GETTING THESE ERRORS IN THE ADMIN SECTION WHEN I GO TO EDIT A REVIEW - OF AN ARTICLE:

 

 

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /article_reviews.php on line 103

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /ADMIN/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /ADMIN/includes/classes/object_info.php on line 18

 

OTHER THAN THAT AND THE CENTERING PROBLEM THE REST LOOKS WORKABLE..

HELP IS APPRECIATED OF COURSE,

Music is body splash for the soul.

Link to comment
Share on other sites

I'M ALSO GETTING THESE ERRORS IN THE ADMIN SECTION WHEN I GO TO EDIT A REVIEW - OF AN ARTICLE:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /article_reviews.php on line 103

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /ADMIN/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /ADMIN/includes/classes/object_info.php on line 18

 

OTHER THAN THAT AND THE CENTERING PROBLEM THE REST LOOKS WORKABLE..

HELP IS APPRECIATED OF COURSE,

 

line 103 of the first error reads: $rInfo_array = array_merge($reviews, $articles, $articles_name);

Music is body splash for the soul.

Link to comment
Share on other sites

Hi, I have downloaded your article_listing contribution

but I don't know where the file goes. Its not part of the main package (v1.51) that I can find. Do I drop that file in the root (catalog/) and what calls it. then how do you add an image and link it to an article. It works fantastic on your site.

 

Also -- Does anbody know how I kill the center thing that happens --- All the main Article pages makes everything CENTERED on the rest of the page.

Not flush left -- I want to take away this centering issue - just can't find it.

 

Thanks in advance!! :thumbsup:

 

Hi!

First, sorry for my bad english.

The article_listing.php goes to the html/includes/modules dir (this file is a Part of the main package)

 

Images

the images goes to the html/images dir

the image names must be in magazin-1.jpg format

(magazin-1.jpg for the article_id/1)

(magazin-2.jpg for the article_id/2 etc)

 

if you want give other names to the heading images you change this line (/includes/modules/article_listing.php):

<img src="/images/magazin-<?php echo $articles_listing['articles_id']; ?>.jpg" alt="<?php echo $articles_listing['articles_name']; ?>" title="<?php echo $articles_listing['articles_name']; ?>">

Link to comment
Share on other sites

I installed it on my live store and finally got it up and running. Although I got two issues that I have to solve.

 

The first is the same as CD Monster previous, with the array error mess. Is it just me or is there a mismatch with PHP4 and PHP5?

 

The second is a bit tricker, cause it inserts some characters and I cant seem to find them.

 

The code that is erroneous is:

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading">1</td>
<td width="100%" height="14" class="infoBoxHeading">Artiklar</td>
<td height="14" class="infoBoxHeading" nowrap>1</td>
 </tr>

</table>

 

You see that there are three rowes for "infoboxheading"? Number 1 and number three comes from somewhere and I cant seem to backtrack it :(

The installation I have running on my testsite gives the following code:

  <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Artiklar</td>
<td height="14" class="infoBoxHeading" nowrap><img src="images/infobox/corner_right.gif" border="0" alt="" width="11" height="14"></td>
 </tr>

 

Any ideas as to where it is coming from?

Link to comment
Share on other sites

I can not install the sql. PhpMyadmin returns the following

 

SQL query: Documentation

 

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\'),'

);

 

MySQL said: Documentation

#1366 - Incorrect integer value: '' for column 'configuration_id' at row 1

 

I am running mysql 5.

 

please help

Link to comment
Share on other sites

Well like I mentioned before, I got the Article Manager running well enough where I can use it correctly and the only problem is when going to review a review. So, I guess I wont use the - leave a review for this article- .

 

I'm trying to use TinyMCE on the - article.php - page but my php skills do not exist. Following the instructions of the TinyMCE Anywhere contribution, it says : if you want to add TinyMCE to Aricle Manager use this code and set but I know Im missing something minor to the link... can someone advise me how to activate the code correctly. Here's what the instruction is:

 

------------------------

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

------------------------

and what I added in between the <head></head> tag:

 

<?php

$mce_str = "articles_description"; // Comma separated list of textarea names

 

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

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

?>

 

But shouldn't I be adding something to the textarea tag:

(roughly line) 760 OF ARTICLE.PHP :

 

<td class="main"><?php echo tep_draw_fckeditor('articles_description[' . $languages[$i]['id'] . ']','700','300',(isset($articles_description[$languages[$i]['id']]) ? $articles_description[$languages[$i]['id']] : tep_get_articles_description($aInfo->articles_id, $languages[$i]['id']))); ?></td>

<?php } else { ?>

 

<td class="main"><?php echo tep_draw_textarea_field('articles_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($articles_description[$languages[$i]['id']]) ? $articles_description[$languages[$i]['id']] : tep_get_articles_description($aInfo->articles_id, $languages[$i]['id']))); ?></td>

 

YOUR HELP IS GREATLY APPRECIATED OF HOW TO FINISH THIS STATEMENT AND I WILL KINDLY PAY YOU ON TUESDAY FOR THE HAMBURGER TODAY !!!

:D

Music is body splash for the soul.

Link to comment
Share on other sites

When I run the v1.5 sql script I get the following error.

 

SQL query: Documentation

 

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\'),'

);

 

MySQL said: Documentation

#1366 - Incorrect integer value: '' for column 'configuration_id' at row 1

 

I am running mysql 5.

 

The configuration_id field is set to auto-increment.

 

any help will be greatly appreciated

 

 

I resolved this issue. I disabled mysql v5 default strict-mode

 

thanks for the response

Link to comment
Share on other sites

Trying to get this contribution to work....I can add articles, authors and cross sell products in the admin section, but no articles will show on my site. I'm using the RC1 store along with STS....any ideas?

 

Visit My Website

 

Thanks,

 

Colin.

I had to do this in the admin to get articles or topics to show at all:

in admin/articles.php

 

change:

<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

to:

<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<?php require(DIR_WS_FUNCTIONS . 'articles.php'); ?>
<!-- header_eof //-->

 

In the admin I'm having issues getting articles to show after i move them into a topic. After being moved I can not get to the articles in order to edit them.

 

I'm going to totally reinstall 1.5 and come back. This is tickin me off, seems everyone but me can get this working right. I've tried it on 2 different servers and i cant edit an article in the admin if it is inside a topic.... just cant get to it at all. any help much appreciated.

Link to comment
Share on other sites

I corrected my install, i had left out an edit in admin/includes/application_top:

 

In admin/includes/application_top.php add the following (at the very end before the last ?>)

// include the articles functions
 require(DIR_WS_FUNCTIONS . 'articles.php');

// Article Manager
 if (isset($HTTP_GET_VARS['tPath'])) {
   $tPath = $HTTP_GET_VARS['tPath'];
 } else {
   $tPath = '';
 }

 if (tep_not_null($tPath)) {
   $tPath_array = tep_parse_topic_path($tPath);
   $tPath = implode('_', $tPath_array);
   $current_topic_id = $tPath_array[(sizeof($tPath_array)-1)];
 } else {
   $current_topic_id = 0;
 }

 

mine is working fine now

Link to comment
Share on other sites

Just installed it and got a problem that is common discussed here:

 

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

 

The solution by 'kevicho' is solved the error for articles_new.php

meanwhile I got on the page message:

'New Articles

No new articles have been added in the last 30 days.'

 

But truly the article is published by admin section!?

Any way to solve?

 

Also would like to ask how to fix the same problem for articles.php?

 

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 = '5' and td.language_id = '5'

 

Thank for advice

Sergei

 

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 :)

Link to comment
Share on other sites

The problem with queries happens only with mysql5. The corrected query for articles_new.php has been posted on this forum already, here is the query for articles.php (about line 295):

 

	$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) left join " . TABLE_AUTHORS . " au using(authors_id)) left join " . TABLE_ARTICLES_DESCRIPTION . " ad using(articles_id), " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td using(topics_id) 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 ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' order by a.articles_date_added desc, ad.articles_name";

 

Note that these queries will not find articles that don't belong to any topic.

 

- Chris

Link to comment
Share on other sites

The 2 files that need to be updated to be MySql5 compatible are now posted on the contribution page. You can copy them over your v1.5 files or better, use a file compare program to merge the changes.

 

- Chris

Link to comment
Share on other sites

Thanks Chris for posting queries.

Tested both updates for articles.php and articles_new.php with success.

Just note that these queries want to delete all topics and articles created before update to make them work.

 

Also a it may be a small bug in english/articles.php because seems

define('TEXT_BY', 'by'); is already used in another language defenition file. But I haven't found yet where.

 

 

The 2 files that need to be updated to be MySql5 compatible are now posted on the contribution page. You can copy them over your v1.5 files or better, use a file compare program to merge the changes.

 

- Chris

 

Up to now no new files posted on the contribution page. Please check

 

Sergei

Edited by leveera
Link to comment
Share on other sites

Contribution updated on 8.8.2007, you can see it here: http://www.oscommerce.com/community/contributions,1709, 2 files in a zip.

 

I don't see why have to delete topics and articles to make these queries to work? I have tested these queries with already written articles as well as new one. The way to save articles and topics, in admin, has not changed, so why should newly created articles work, and not old ones? Maybe I miss something, somebody else with this problem?

 

- Chris

Link to comment
Share on other sites

I just uploaded Article Manager v1.5, and when I go into the Configuration under Article manager it is all in french. How can I change this to english? Is there a certain file I need to check?

 

Thanks

David

I fixed it just ignore my post. Thanks David

Link to comment
Share on other sites

Trying to get this contribution to work....I can add articles, authors and cross sell products in the admin section, but no articles will show on my site. I'm using the RC1 store along with STS....any ideas?

 

Visit My Website

 

Thanks,

 

Colin.

 

I have the same problem.

 

Everythng working in Admin. Articles.php showing black under current articles.

 

Suggested fix does not work. Any ideas?

Link to comment
Share on other sites

Hmmmm. Ok.

 

Checked it without my template.

 

The infoboxes appear to be working correctly. Ie. it shows new authors and it shows there are new articles.

 

However, like I said before, when you click on any of the article manager pages such as articles.php, they are without articles/topics. It just says 'All Articles

Current Articles' (to give articles.php as an example).

 

Any help appreciated.

 

Thanks

Link to comment
Share on other sites

I don't see why have to delete topics and articles to make these queries to work? I have tested these queries with already written articles as well as new one. The way to save articles and topics, in admin, has not changed, so why should newly created articles work, and not old ones? Maybe I miss something, somebody else with this problem?

 

- Chris

 

 

Hi Chris,

 

As a matter of the fact I got configuration error windows in my shop after I executed MySql5 queries, but this error left after I deleted topics and articles and created a new. Just for report.

 

I also spotted the bug in breadcrumb whenever it is in old or new format

catalog >> articles>> topic name

catalog >> topic name

 

I have topic name is always in English even if the site switched in another language.

 

Sergei

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