Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * - 8 votes

Article Manager v1.0


2060 replies to this topic

#21 daithi

  • Community Member
  • 159 posts
  • Real Name:dave
  • Location:Ireland

Posted 06 December 2003, 22:49

Quote

  Hi Dave
QUOTE
as the tell_a_friend.php is a rarely modified page, it might be no harm in including your updated version in the contrib as a straight replacement - it would cut down on the install instructions quite a bit...

Good idea, I will get this out shortly, it would simplify things a bit ;-)

the only mod that i know of that changes this page is the 'also tell admin of tell a friend use' not sure what it is called... but if you find it it could also be good to add this feature to tell a friend about article...

Quote

Just curious, if you look in the articles table in your database, is the articles_date_added field being filled in? This is what is used in article_info.php to display the expected or published date.

yeah, that is filled in.

Quote

Also, when you update an article is it saving the Article Content OK, i.e. in the articles_description table is the articles_description field being populated. If not, it may be a problem with the WYSIWYG Editor install, in which case try turning it off in the Articles manager configuration (Use WYSIWYG HTMLAREA Editor? = Disable) and see if that makes a difference.

Let me know how you get on.

Regards, Rob


yeah, that also seems fine.
I just added an author (previously had no authors) and the page displays fine - so looks like it could be an sql query issue if the article has no author assigned to it?
dave.

#22 daithi

  • Community Member
  • 159 posts
  • Real Name:dave
  • Location:Ireland

Posted 06 December 2003, 22:57

Quote

I just added an author (previously had no authors) and the page displays fine - so looks like it could be an sql query issue if the article has no author assigned to it?
dave.

just confirmed that for my install - ie. i removed:
and a.authors_id = au.authors_id
from line 74 of article_info.php and now the articles display as expected - not sure what issues removing this will cause though....


again, thanks for a super contrib - if anyone following this thread wants a cms for osc or wants to replace the excellent faqdesk & newsdesk with an MS2 compliant easy install - go for this!
dave.

#23 RobAnderson

  • Validating
  • 60 posts
  • Real Name:Rob Anderson
  • Location:Auckland, New Zealand

Posted 07 December 2003, 01:21

Hi Dave, well done, you found a bug ;-)

Quote

just confirmed that for my install - ie. i removed:
and a.authors_id = au.authors_id
from line 74 of article_info.php and now the articles display as expected - not sure what issues removing this will cause though....
While your fix will display the article (if no author is assigned), you may find that author names do not display for other articles in article_info.php as a consequence. You may also be left with the TEXT_BY entry "by" at the top right-hand corner of your Article Info page.

So, you may want to try the fix below, which I will be building into v1.1 (should be posted later today).

Article Manager v1.0 bug fix if no Author assigned to article.

In catalog/article_info.php replace line 74 with:
     $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, " . TABLE_ARTICLES_DESCRIPTION . " ad left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id 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 . "'");
also, in the same page, replace line 87 with:
             <td class="main" align="right" valign="bottom"><?php if (tep_not_null($articles_author)) echo TEXT_BY . '<a href="' . tep_href_link(FILENAME_ARTICLES,'authors_id=' . $articles_author_id) . '">' . $articles_author . '</a>'; ?></td>
That should do it!

Thanks very much for your feedback Dave, I really appreciate another set of eyes!

Regards, Rob

#24 RobAnderson

  • Validating
  • 60 posts
  • Real Name:Rob Anderson
  • Location:Auckland, New Zealand

Posted 07 December 2003, 05:02

Article Manager v1.1 has just been released and includes the following changes:

- Bug fix to article_info.php to display article if no author assigned (see previous post)
- Full tell_a_friend.php file and associated language file included to simplify installation
- Updated installation instructions

Thanks to Dave (daithi) for these suggestions.

Note: If you have installed Version 1.0, you DO NOT need to reinstall. Simply follow the instructions in the following post to fix a minor bug:

http://forums.oscommerce.com/index.php?sho...ndpost&p=269972

Thanks everybody for your enthusiastic responses, it makes all those late nights worth it ;-)

Regards, Rob

Edited by RobAnderson, 07 December 2003, 05:06.


#25 Kristofor

  • Community Member
  • 301 posts
  • Real Name:Kristofor Lawson
  • Location:Australia

Posted 07 December 2003, 06:21

hey, cool,
i couldnt get the previous one to work, but this new verion works perfectly,

Great mod, now to get to writing some articles
hehehehe

thanks again

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

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

#26 Kristofor

  • Community Member
  • 301 posts
  • Real Name:Kristofor Lawson
  • Location:Australia

Posted 07 December 2003, 06:40

just one question though,

How can i align the text displayed in the articles and authors boxes, to the right?
Don't die with the music in you!!!

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

#27 RobAnderson

  • Validating
  • 60 posts
  • Real Name:Rob Anderson
  • Location:Auckland, New Zealand

Posted 07 December 2003, 08:35

Hi Kristofer, in response to:

Quote

just one question though,

How can i align the text displayed in the articles and authors boxes, to the right?
To right align the text entries in the Authors box (presuming it's set in the configuration to display as a list, not a drop-down), in catalog/includes/boxes/authors.php, replace line 37 with:
      $info_box_contents[] = array('align' => 'right', 'text' => $authors_list);
To right align the text entries in the Articles box, in catalog/includes/boxes/articles.php, replace line 179 with:
  $info_box_contents[] = array('align' => 'right', 'text' => $new_articles_string . $all_articles_string . $topics_string);
That should fix them ;-)

Rob

#28 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 07 December 2003, 11:59

Hey Rob...

First off, great contrib. This is a very good example of just how versatile osCommerce really is. Good Job.

I have a few suggestions for you...

1. Article Submission
It would be a great feature to have for those that would use it. Should have the choice to have Admin review of all submissions before the artcile gets posted.

2. Authors Listing Page
Just a simple list with some basic stats about the Author, such as name, number of Articles written/published, link to Authors article listing page, etc.

3. More Information about the Author
I like the idea of having an Image associated with the Author, whether it be a photo or graphic. I would also like to see things like location of Author, Company Name (if any), email address, contact info, etc.

Let me know what you think.

-R
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"

#29 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 07 December 2003, 12:48

I thought of a few more suggestions...

4. Most Viewed or Top 10 Article/Topic List

5. Conditions for long Articles.
If the Article runs long, it would be a great feature to limit the number of lines/words per page and have the rest of the article show up on additional pages. Otherwise, the length of the Article can cause the page itself to get very long and starts to effect page layout.

6. Featured Articles and/or Topics.
An additional Content box that would appear on a given page, lets say index.php, that would have the Article Title, Author, Publish Date and a truncated peice of the beginning of the article.

7. A Printer-friendly link on the Article Page to view and print the Article.

If I think of anymore, I will post them.

-R
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"

#30 davidturetsky

  • Community Member
  • 75 posts
  • Real Name:David B Turetsky
  • Location:Pennsylvania

Posted 07 December 2003, 14:23

Yes, excellent contrib. Also, could you purpose this as a news center as well? And, have the ability to publish content to the main page, or an articles page.

#31 Salvo

  • Community Member
  • 1,005 posts
  • Real Name:Salvo
  • Gender:Male

Posted 07 December 2003, 14:34

Hi all,

Just downloaded the new updated articles manager and installed to new ms2.

works well, BUT I have found some bugs..

I have created one topis and two SUB TOPICS and this is what I get.

Warning: Division by zero in c:\program files\easyphp1-7\www\new_install\articles.php on line 139

line 139 has:
$width = (int)(100 / MAX_DISPLAY_TOPICS_PER_ROW) . '%';
where is the MAX_DISPLAY_TIPIC_PER_ROW?

I can't find it..



test 23

Edited by Salvo, 07 December 2003, 14:35.


#32 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 07 December 2003, 20:36

Salvo...

You are right, I got the same error while testing. When a "parent" Topic has 2 or more Sub-Topics, you get the "Division By Zero" error.

Here is why it happens and how to fix it...

REASON:
The section of code that causes the error is trying to calculate using a Configuration Value that IS NOT there.

There is no MAX_DISPLAY_TOPICS_PER_ROW as a configuration option included with this contrib. Yet, that is what its trying to use to calculate.

SOLUTION:

Run the folowing MySQL statement to INSERT the MAX_DISPLAY_TOPICS_PER_ROW configuration option...
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 ('', 'Topics To List Per Row', 'MAX_DISPLAY_TOPICS_PER_ROW', '3', 'How many Topics to list per row?', 456, 4, now(), now(), NULL, NULL);
That will fix the error.

davidturetsky...

Yes, this can be used as a News Center. Some renaming of the Heading Titles and you should be good to go. As far as content display on the main page, I suggested that possibility earlier. Depending on your experience level, you could probably add this option yourself. The information is in the database, its just a matter of extracting the data and displaying it.

Hope this helps.

-R
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"

#33 RobAnderson

  • Validating
  • 60 posts
  • Real Name:Rob Anderson
  • Location:Auckland, New Zealand

Posted 07 December 2003, 20:59

Hi Salvo, in response to your bug:

Quote

I have created one topis and two SUB TOPICS and this is what I get.

Warning: Division by zero in c:\program files\easyphp1-7\www\new_install\articles.php on line 139

line 139 has:
$width = (int)(100 / MAX_DISPLAY_TOPICS_PER_ROW) . '%';
where is the MAX_DISPLAY_TIPIC_PER_ROW?

I can't find it..
This is a bug. Thanks for finding it ;-)

I hadn't tested below the level of sub-topics (bad Robert), and on the third or deeper levels, you will get the error you mentioned.

The recommended fix is in catalog/articles.php, comment out or delete lines 133 to 145, i.e. the ones shown below:
//    $number_of_topics = tep_db_num_rows($topics_query);
//
//    $rows = 0;
//    while ($topics = tep_db_fetch_array($topics_query)) {
//      $rows++;
//      $tPath_new = tep_get_path($topics['topics_id']);
//      $width = (int)(100 / MAX_DISPLAY_TOPICS_PER_ROW) . '%';
//      echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">' . tep_image(DIR_WS_IMAGES . $topics['topics_image'], $topics['topics_name'], SUBTOPIC_IMAGE_WIDTH, SUBTOPIC_IMAGE_HEIGHT) . '<br>' . $topics['topics_name'] . '</a></td>' . "\n";
//      if ((($rows / MAX_DISPLAY_TOPICS_PER_ROW) == floor($rows / MAX_DISPLAY_TOPICS_PER_ROW)) && ($rows != $number_of_topics)) {
//       echo '              </tr>' . "\n";
//       echo '              <tr>' . "\n";
//      }
//    }
As MAX_DISPLAY_TOPICS_PER_PAGE is no longer used, you can safely ignore it.

That should enable the sub-sub-topic page, description and any articles to load properly.

One other thing I noticed is that there is a broken image in the top right-hand corner of any sub-sub-topic page. This was not intended as any topic images should only be enabled through additions in the WYSIWYG Editor.

So, if this is bugging you, here's the fix:

In catalog/articles.php, line 92, replace:
            <td valign="top" class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $topic['topics_image'], $topic['topics_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
with
            <td valign="top" class="pageHeading" align="right"></td>
This effectively removes the broken image reference but leaves the cell intact.

Hope this helps, thanks for your feedback

Regards, Rob

P.S. I will accumulate a few more bugs before rolling this fix into the next version. For others that have installed version 1.0 or 1.1, then these fixes are only necessary if you intend to have levels deeper than one sub-topic. Otherwise, you will probably never see them.

#34 RobAnderson

  • Validating
  • 60 posts
  • Real Name:Rob Anderson
  • Location:Auckland, New Zealand

Posted 07 December 2003, 21:07

Thanks Randy, for your alternative solution to Salvo's problem.

Quote

Here is why it happens and how to fix it...

REASON:
The section of code that causes the error is trying to calculate using a Configuration Value that IS NOT there.

There is no MAX_DISPLAY_TOPICS_PER_ROW as a configuration option included with this contrib. Yet, that is what its trying to use to calculate.

SOLUTION:

Run the folowing MySQL statement to INSERT the MAX_DISPLAY_TOPICS_PER_ROW configuration option...

CODE 
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 ('', 'Topics To List Per Row', 'MAX_DISPLAY_TOPICS_PER_ROW', '3', 'How many Topics to list per row?', 456, 4, now(), now(), NULL, NULL);

That will fix the error.
Gotta love this forum, spoilt for choice!

I guess it depends on whether you need topic links from within the sub-topic pages or whether you intend to rely on the Articles Box for navigation. Your fix would enable them in the page, mine would remove them.

As I haven't given much thought as to how these would be formatted, and the fact that I deliberately stripped topic images out of the articles page (or thought I had), means that the normal categoreis/image type layout may not work so well in this case.

Plenty of room for others to contribute ideas...

Regards, Rob

#35 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 07 December 2003, 21:28

Looks like I found another issue with the sub-Topic Listing. After the above fix is applied, the Sub-Topics are listed without error. But, if you click on the Sub-Topic Link, you are taken to the All Articles page.

If you mouseover the Sub-Topic, you will see the link URL displayed in the status bar of your browser. There, it shows a link URL of...

http://www.domainname.com/catalog/articles.php?cPath=3

I have searched throughout the code for this contrib and cannot find any reference to $cPath anywhere. So where is this coming from?

Any ideas?

-R
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"

#36 RobAnderson

  • Validating
  • 60 posts
  • Real Name:Rob Anderson
  • Location:Auckland, New Zealand

Posted 07 December 2003, 21:37

Hi Randy, thanks a lot for your considered feedback. I'm overwhelmed with the response so far and the great ideas keep coming ;-)

Here are some quick responses to your suggestions:

Quote

1. Article Submission
It would be a great feature to have for those that would use it. Should have the choice to have Admin review of all submissions before the artcile gets posted.
This is an interesting one, because my orginal intention was to have only articles posted by the site administrator or selected contributors (in which case the administrator would input them). I didn't see the contribution going the way of a"community" newsboard, like PHP-Nuke, but...

I may leave this for someone who wants this as a variation, e.g Article Contributor?? Still if it was built in as an option, then you could take it or leave it I guess.

Quote

2. Authors Listing Page
Just a simple list with some basic stats about the Author, such as name, number of Articles written/published, link to Authors article listing page, etc.
Yes, this is a definite and was in fact next on my list of enhancements. So look for this in Version 2, but please if anybody wants to offer this as an add-on, please do so in the meantime. My thoughts are to add in a meta-description field in the authors_info table (to support languages) and use this as an abstract in the same way that I do for articles. Shouldn't be too difficult.

Question: where to link from, the Authors box (messy if using drop-down) or the Articles box (probably better, e.g. Author List). Thoughts?

Quote

3. More Information about the Author
I like the idea of having an Image associated with the Author, whether it be a photo or graphic. I would also like to see things like location of Author, Company Name (if any), email address, contact info, etc.
This is possible right now by using the WYSIWG Editor and the Author description field. Admittedly, it is not laid out prescriptively, so you would have to do all the formatting yourself, but it does support images, links, etc.

As for building in more fields for the Author, the advantage would be that it makes it easier for people to add and keep consistent, but it then limits the flexibility with which you may choose to display it. Always trying to find that balance!!!

Quote

4. Most Viewed or Top 10 Article/Topic List
Good idea. Probably a bit beyond my skills at the moment unless I can find a good contribution to copy from (which is all I really do anyway!). Know of any like this?

Also, where would you see this being displayed. As a module to plonk anywhere?

Quote

5. Conditions for long Articles.
If the Article runs long, it would be a great feature to limit the number of lines/words per page and have the rest of the article show up on additional pages. Otherwise, the length of the Article can cause the page itself to get very long and starts to effect page layout.
Hmmm, hadn't thought of that! Again, great idea and I could see the use for it. Any suggestions of contributions that do similar things? I know how the article listing works now in terms of splitting article lists up over several pages, but that works on records, not charachters within a record.

Quote

6. Featured Articles and/or Topics.
An additional Content box that would appear on a given page, lets say index.php, that would have the Article Title, Author, Publish Date and a truncated piece of the beginning of the article.
Yes, good idea for a module. And given we have an already made article abstract, it would be just a matter of using a random function to choose an appropriate article. I'll put this on my list for Version 2.

Another thought I had kinda related was to merge Article reviews with Product reviews using the same box..

Quote

7. A Printer-friendly link on the Article Page to view and print the Article.
Thought about this too, but put it down for later. I'm pretty handy with style sheets so could develop a print media version or alternatively look at modifying the excellet PDF datasheet to display the article in PDF format. Now that would be cool!
Fair bit of development time for either one...When will I sleep?

Here's an ideas for anybody with search engine experience. How to incorporate the option to search either products, articles or both in the search feature (simple and/or advanced). Any takers??

Great ideas, keep them coming.

My priority is on fixing bugs at the moment, but I will definetly incorporate all ideas I can into the next major upgrade (Version 2 - won't be before end of year sorry).

Cheers, Rob

#37 RobAnderson

  • Validating
  • 60 posts
  • Real Name:Rob Anderson
  • Location:Auckland, New Zealand

Posted 07 December 2003, 22:00

Hi Randy, in response to your hunt for cPath:-)

Quote

Looks like I found another issue with the sub-Topic Listing. After the above fix is applied, the Sub-Topics are listed without error. But, if you click on the Sub-Topic Link, you are taken to the All Articles page.

If you mouseover the Sub-Topic, you will see the link URL displayed in the status bar of your browser. There, it shows a link URL of...

http://www.domainname.com/catalog/articles.php?cPath=3

I have searched throughout the code for this contrib and cannot find any reference to $cPath anywhere. So where is this coming from?
$cPath in this case should be $tPath (I renamed everything I could to try and distinguish between categories c and topics t), but is generated from the wrong function, i.e. it is using the generic tep_get_path instead of tep_get_topic_path on line 138 of catalog/articles.php, i.e.

      $tPath_new = tep_get_path($topics['topics_id']);
should be
      $tPath_new = tep_get_topic_path($topics['topics_id']);

Try that. It does now generate a proper link to the child topic with no cPath in the URL.

As mentioned earlier, I think the formatting of these links is poor and not well suited for moving between article topics. An alternative is to try my fix and do away with these links altogether.

Rob

P.S. Do you guys really need three or more levels of articles???

#38 Kristofor

  • Community Member
  • 301 posts
  • Real Name:Kristofor Lawson
  • Location:Australia

Posted 07 December 2003, 22:06

RobAnderson, on Dec 8 2003, 08:00 AM, said:

$cPath in this case should be $tPath (I renamed everything I could to try and distinguish between categories c and topics t), but is generated from the wrong function, i.e. it is using the generic tep_get_path instead of tep_get_topic_path on line 138 of catalog/articles.php, i.e.

      $tPath_new = tep_get_path($topics['topics_id']);
should be
      $tPath_new = tep_get_topic_path($topics['topics_id']);

Try that. It does now generate a proper link to the child topic with no cPath in the URL.
Woudnt, this have been fixed anyway, when those lines were deleted with your earlier fix?

Yeh, anyway, thanks for that allignment stuff, worked really well.

Its a great mod,

Thanks again

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

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

#39 RobAnderson

  • Validating
  • 60 posts
  • Real Name:Rob Anderson
  • Location:Auckland, New Zealand

Posted 07 December 2003, 22:09

Hi David, regarding your question:

Quote

Yes, excellent contrib. Also, could you purpose this as a news center as well? And, have the ability to publish content to the main page, or an articles page.
I see no reason why not. In fact, based on other feedback, I'm getting a strong indication that a range of different modules might be in order to display articles in a range of different ways, e.g. simple articles listing for Home Page news feature, or Top 10 articles including number of times viewed.

I will look at developing a few of these for Version 2 in the New Year. I simply don't have the time at the moment unfortunately.

However, the basis of a module is in the catalog/articles_new.php page. You would just need to chop out the article listing part and then format it to suit. It could then be included in your Home Page quite easily.

Regards, Rob ;-)

#40 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 07 December 2003, 22:10

Rob... That was it. The Sub-Topic Link issue is fixed.

Thanks.

-R
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"