osCmax v2.5 User Manual
Results 1 to 2 of 2

Latest Article on index page

This is a discussion on Latest Article on index page within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; here is a very easy way to add your latest article on your index page. in index_default.tpl.php just before the ...

      
  1. #1
    New Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0


    Default Latest Article on index page

    here is a very easy way to add your latest article on your index page.

    in index_default.tpl.php
    just before the last </table>
    add:

    Code:
            <tr>
                <td class="main">
                    <?php
                        $article_info_query = tep_db_query("select a.articles_id, a.articles_date_added, a.authors_id, ad.articles_name, ad.articles_description" . TABLE_ARTICLES . " a left join " . TABLE_AUTHORS . " au using(authors_id), " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_status = '1' and ad.articles_id = a.articles_id and ad.language_id = '" . (int)$languages_id . "' order by a.articles_date_added desc limit 0,1");
                        $article_info = tep_db_fetch_array($article_info_query);
                        ?>
                        <table border="0" width="100%" cellspacing="0" cellpadding="2" align="center" bgcolor="#b6b7cb">
                        <tr><td class="infoBoxHeading" align="center">Latest Article: <?php echo $article_info['articles_name']; ?></td></tr>            
                        <tr><td class="productinfo"><?php echo $article_info['articles_description']; ?></td></tr>
                        </table>
                </td>
            </tr>
    Demo at http://self-defense-tools.com

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default Re: Latest Article on index page

    That is a useful bit of hacking. I am sure it will get a lot of use! I appreciate you posting it up.
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

Similar Threads

  1. How to edit index page
    By madone in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 03-16-2009, 10:14 AM
  2. the index page
    By rickarooni in forum osCmax v2 Customization/Mods
    Replies: 4
    Last Post: 07-06-2008, 10:58 AM
  3. catalog index page
    By melm81 in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 12-19-2005, 06:56 AM
  4. Help! First page index.php is blank
    By freddae in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 01-03-2005, 02:41 PM
  5. MS2 Max 1.5 - cannot go back to index page
    By goldie in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 10-21-2003, 10:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •