Jump to content


  • Content count

  • Joined

  • Last visited

Posts posted by RobAnderson

  1. I need may be something different. I have USD as base currency, and rubles as default currency. So I enter prices in USD, and, since the exchange rate is like 29,21, I get ugly prices in rubles. like 2349, 41 rub.


    What I need is to round prices in rubles. So, for example, price in rubles would be 2350 rub.


    Does your contribution do this work?

    Hi Vladamir, I'm not sure if I entirely understand your question.


    If your default currency is rubles, and you are using the Friendly Pricing contribution with base currencies in USD, then yes, the ruble values will float with the currency.


    However, if you want nicely rounded prices in rubles, why not then just revert back to the default currency (rubles) for those products? Of course, if you do this, then the USD value will float with the currency - you can't have it both ways! (unless there is a contribution that allows currencies to be de-coupled, which could be very confusing for customers).


    Hope this helps, if not, please post more specific info and I'll try to help.



    Rob Anderson :)

  2. Is there any contribution out there which will help to solve my problem? That is:


    For certain products (not for all) I will need to be able to set two fixed prices for the main currency which is Swiss Francs and for the other currency which is Euro. If there is only one currency set in admin, the amount will be automatically calculated using the exchange rate.


    Any suggestions?




    Hi Martin, I can see what you're trying to do now and it makes perfect sense. However, I don't know of any contributions that allow that although I do know of some other people with the same requirements, e.g. moonfish (Dani).


    Looks like you might need to create a contribution that adds in this functionality. Time to learn PHP? ;-)


    Best of luck, Rob

  3. Hi Martin, I don't think that the Friendly Pricing contribution will help in this case. If I understand you correctly, you are after the ability to set fixed prices for the same product in two currencies.


    What my contribution allows you to do is choose which currency you wish to fix the price in on a product by product basis, e.g. one product could have a fixed price of 29.90 Swiss Francs and another could have a fixed price of 19.90 Euro. However, having done this, the price will still vary from one currency to another (as you've discovered). What it doesn't allow you to do though, is create two fixed prices for the same product!


    Having said that, there may be one way around it with my contribution, and that would be to create a duplicate product and assign one a fixed price in one currency, e.g. 29.90 Swiss Francs and the other a fixed price in a different currency, e.g. 19.90 Euro.


    The only problem I can see with this is that this may cause confusion and people may wonder whether the products are actually the same as the relative prices would be different. You also open yourself up to the vagaries of currency changes, but I'm sure you're already aware of that.


    Sorry, that's about all I can suggest, except to keep looking for other contibutions that may have the functionality you're after (multiple-shops?).


    Cheers, Rob

  4. Hi Juha, in response to your question:


    I think the best way to do this would be to modify the Browse by Categories contribution which is based on Categories/Products and change it to display Topics/Articles (the architecture is essentially the same). This should produce a similar layout to what you are after and could be inserted as a module in place of the default listing produced in the articles.php page.


    This may well be included in a future release, but sorry I don't have working example for you yet (Randy?).


    Regards, Rob

    hmm, would it that hard to modify articles.php in your mod to do this? I mean, it's quite easy to order the articles by topic and date as it is, just by editing the 'ORDER BY' in the query.


    After that all I had to do would be to come up with a routine that lists the articles under each topic title. That way I could get rid of the topic name listed for each article on the right side of the page.


    I might also add that I don't use nested topic categories, just one level of them. Plus in the articles box, I have only All Articles listed.


    What do you think?

    Hi Juha, yeah, given that you're only dealing with one level of articles, then your suggestion would be the way to go. I guess I was thinking of multiple levels (and as you've seen from my bug fixes, there are some people out there that want 3+ levels of articles!!!). For my part, like you, I wrote this contribution with only one level in mind (but naturally wanted it to support more).


    Dang, OSC is so damn flexible, it's hard to cater for everybody ;-)


    Looking at what you're trying to do then, a simple sort by topics and then article name should do it with a bit of tweaking (removing the topics as you mentioned). The rest is just layout really which is straight HTML stuff.


    By all means send me some code if you get stuck. I'll try my best ;-)


    Regards, Rob


    BTW. How do you have only articles listed in the articles box, yet are using one level of topics. Did I miss something?

  5. Rob,


    The one thing I was thinking about with the article manager was to be able to have articles in specific parts of the web site. I have a ton of extra room at the bottom of my pages and If you could put specific articles under the new products for the month are refferring to the category of product you are looking for. ie: Suspension Articles in the Suspension category. Take a peek at the site to get a better idea.



    Imagine a few articles underneath the new products for december, say 4.

    They would be displayed as:


    ARTICLE TITLE By: Whoever

    blah blah blah.. The article starts

    and there is a designated size for the article to fit in

    say 200 x 200 area box and at the bottom of

    the preview of the article it says

    Check out the rest of the story.....

    as a hyperlink to the actual full article.


    Just an Idea but I think many people would realy like it if it had the feature.

    Hi Mike, that's a really good idea. A bit like the cross-sell module but related to topics instead of products. I'll add that to my list!


    Thanks very much for your suggestion, I'm going to have a lot of great ideas for the next version. I'm only sorry I don't have the time to devote to it right now (with Christmas looming).


    I hope you understand ;-)


    Regards, Rob

  6. Hi Lonnie, about your search idea ;-)


    Is this search going to provided via an infobox?  If there is a choice I would vote for having a page with a search box at the top and the article folders below.  Also a back button would be great for the article pages.  I picture something like the image below (search box was taken from Invision Board).  Just an idea.



    Hmmm, nice idea, a bit like a Yahoo directory and search combined. I was originally thinking of reproducing the default search fucntionality of OSC, i.e. search infobox and advanced search page, but I like your idea better (more functional).


    The problem is that it might stretch my programming skills a bit more, so if you're not in a hurry...


    Rob ;-)

  7. Hi Juha, in response to your question:

    I want to change the articles.php so that when I click All AArticles link, I get a listing of all articles, sorted out according to their topics. In this manner:


    Topic 1





    Topic 2





    How would you make this, with an additional while loop or something?

    I think the best way to do this would be to modify the Browse by Categories contribution which is based on Categories/Products and change it to display Topics/Articles (the architecture is essentially the same). This should produce a similar layout to what you are after and could be inserted as a module in place of the default listing produced in the articles.php page.


    This may well be included in a future release, but sorry I don't have working example for you yet (Randy?).


    Regards, Rob

  8. Article Manager v1.2 has just been released and includes a number of minor bug fixes. Please visit http://www.oscommerce.com/community/contributions,1709 to catch up on these.


    I would like to thank everybody who has posted suggestions for enhancements to this popular contribution (Randy et al ;-). A number of these are planned for Version 2 when I find the time to cobble them together!


    Suggestions include:

    - searching

    - ability to contribute articles

    - authors' page

    - lots of modules, e.g.

    - featured author,

    - news style listing

    - top 10 articles

    - topic lists


    See http://forums.oscommerce.com/index.php?sho...ndpost&p=270378 for a discussion on these and more...


    Please keep the great ideas coming ;-)


    Regards, Rob

  9. Hi Lonnie, regarding plans for searching...

    Is there currently a way or plans to make a way for the articles to be searchable?  I am going to use it as a knowledgebase and this would be the only thing missing.

    I am working on this now and it will be along the lines of the products search, e.g. via a Search Articles box (optional) or a more advanced Search Articles page (with options to filter searches by topics, authors and dates).


    Basically a hack of the MS2 search facility ;-)


    I've done most of it, just need to tidy up a few things (search results) and test.


    Before I post, do you or others have any requests for what would be included in the search results, e.g. I'm thinking Article Name (duh), Author and Date Added. Do we need Topic and an Article Abstract?? Also, should I make these options that you can turn on or off in the admin like the basic article listing?


    Thoughts appreciated.


    Rob ;-)

  10. Hi Jiten, in response to the problem deleting a topic:

    Only 1 problem - a bug maybe?


    When i try and delete a Topic folder with an article in it I get the following error message:


    1146 - Table 'shop.table_additional_article_images' doesn't exist
    delete from TABLE_ADDITIONAL_ARTICLE_IMAGES where articles_id = '2'
    [TEP STOP]

    I cannot figure out why this is happening - I did use your sql file and phpmyadmin "successfully" inserted it into the database?


    Any ideas?

    Yes this is a bug.


    To fix, in admin/includes/functions/articles.php, delete line 307, i.e.

        tep_db_query("delete from " . TABLE_ADDITIONAL_ARTICLE_IMAGES . " where articles_id = '" . (int)$article_id . "'");

    That should enable topics that contain articles to be deleted successfully.


    Thanks for your help.


    Regards, Rob


    P.S. I'll roll this into v1.2 soon.

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

    Excellent, I haven't had much experience with deep sites and multiple levels, so this was new for me (hence my shallow testing ;-).


    Just curious, I noticed there aren't similar links from the top level topics nor links going up to parent levels, so how useful is this (or have I hacked the default page too much - never did get my head around how it worked entirely!!!)



  12. Hi Kristofer, regarding your query:

    Woudn't, this have been fixed anyway, when those lines were deleted with your earlier fix?

    Yes it would. This fix is only required if you wish to display links to child-topics. Otherwise, just delete or comment them out and you won't have to worry about it.


    Glad to hear your alignment is sorted ;-)



  13. Hi David, regarding your question:

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

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

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




    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.




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

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

    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.

    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?

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

    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?

    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.

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

    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

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

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



    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.




    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.

    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

  17. Hi Salvo, in response to your bug:

    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>


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

  18. Hi Kristofer, in response to:

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



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




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


    Regards, Rob

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


    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

  21. Hi Dave

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


    still need to sort out why the article and date aren't displaying though - i am also using a fairly stock 2.2MS2 but as i missed that previous step could i have missed something else???? not sure as there is nothing to change in relaton to the article_info.php page.

    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.


    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

  22. Hi Kristofor, in response to:

    What is it talking about, i dont have any articles_header_tages.php, and i need to do the 2nd thing, but i cant cause i dont have that file.


    So what do i need to do??

    The articles_header_tags.php page should have been added earlier on in the installation. It is included in the catalog/includes/languages/english folder of the install package.


    As for modifying this page (as mentioned in the Post-Installation instructions), this is only required if you had previously installed Linda McGrath's Header Tags Controller. If you don't have this contribution installed, then ignore this step (but you still need the articles_header_tags.php page!)


    Hope this helps, Rob

  23. Hi sparks, in response to:

    One question though, any way to sort the articles other than by date?

    No admin or user control of sorting has been built in (yet...). However, there are three separate listings that can be modified if you wish to change from the default sort option of most recent first.


    The New Articles listing is set by the query in the articles_new.php page, line 65. At the end of the line, you can modify the order by code and specify a different field to sort by, e.g.


    order by a.articles_date_added desc, ad.articles_name

    could be changed to


    order by ad.articles_name

    to sort by name instead of the most recent article first (that's what the default a.articles_date_added desc does).


    Similar modifications could be applied to the All Articles listing in the articles.php page, line 309 or to the Authors/Topics listings in the articles.php page on lines 175, 178, 184 and 187.


    Hope this helps ;-)



  24. Hi Dave (again ;-), in response to:

    when i click on the article name to view the full article, it calls article_info.php?articles_id=1

    but the page displays with:


    This article was published on .

    Current Reviews: 0


    ie. no article and no date.

    This sounds like an install or version problem as I can't think why the article content would not display, nor why there would be no date display.


    Just curious, but what version of OSC are you using (as some functions may have changed)? This contribution has been written for the 2.2MS2 release (Jul 03), so it may not work properly with earlier versions (MS1) or later snapshots.