osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

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



Find us on Facebook
Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Connect with Facebook Register FAQDonate Members List Calendar Mark Forums Read


Reply

 

LinkBack Thread Tools
  #1  
Old 03-10-2010, 01:54 PM
New Member
 
Join Date: Feb 2010
Posts: 9
Thanks: 0
Thanked 3 Times in 3 Posts
Rep Power: 0
wowsaver is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to wowsaver For This Useful Post:
michael_s (03-11-2010)
  #2  
Old 03-11-2010, 05:03 AM
michael_s's Avatar
osCMax Developer


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 16,522
Thanks: 149
Thanked 652 Times in 558 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
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

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

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 User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

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


All times are GMT -8. The time now is 07:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2010 osCmax
Inactive Reminders By Icora Web Design