Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Latest news mod

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 10-16-2004, 08:50 AM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default Latest news mod

Hi,

I'm using BOOMER Tabbed Menu Mod and I wanted to use it in a more diverse way: intregrating "latest news" and getting th last 10 items displayed into one of the Tabs.

The forum is great thing for learning, espcialy how fellow members resolve problems. I came across a post of Leon, when it hit me :P
http://forum.x-cart.com/viewtopic.php?t=8414


It's a very basic mod. Simply wanted a thing something else ... especially since Jon's news mod with admin function is still in beta-testing.

Let's take it step by step.

Step 1:
Create in the Admin a language variable called "lbl_news_none".
I gave this contence: "The Latest News section is empty !"

Step 2:
make a new file or edit modules/News_Management/news_last.php and change the sql part to:
Code:
# # define the first & latst news you want to retreve. Edit these values to your liking # $first=0; $last=10; $news_message = func_query("SELECT $sql_tbl[newsletter].* FROM $sql_tbl[newslists], $sql_tbl[newsletter] WHERE $sql_tbl[newsletter].listid = $sql_tbl[newslists].listid AND $sql_tbl[newslists].avail = 'Y' AND $sql_tbl[newslists].show_as_news = 'Y' AND $sql_tbl[newsletter].show_as_news = 'Y' ORDER BY $sql_tbl[newsletter].send_date DESC LIMIT $first,$last"); if (count($news_message) ==0) $news_message=""; $smarty->assign("news_message", $news_message);

Step 3:
replace the contence of today_news.tpl with:
Code:
{* $Id: today_news.tpl,v 1.10 2004/05/31 06:25:32 max Exp $ *} {capture name=latestnews} {if $news_message} <TABLE width=100% border=0 cellspacing=0 cellpadding=2> {section name=number loop=$news_message} <TR> <TD> {$news_message[number].send_date|date_format:$config.Appearance.date_format}: {$news_message[number].subject} {$news_message[number].body} <HR> </TD> </TR> {/section} </TABLE> {else} <TABLE width=100% border=0 cellspacing=0 cellpadding=2> <TR> <TD> {$lng.lbl_news_none} </TD> </TR> </TABLE> {/if} {if $usertype eq "C"} <TABLE width=100% border=0 cellspacing=0 cellpadding=2> <TR> <TD> {$lng.lbl_previous_news} </TD> </TR> </TABLE> {/if} {/capture} {include file="dialog.tpl" title=$lng.lbl_news content=$smarty.capture.latestnews extra="width=100%"}

Step 4:
For people using BOOMERS Mod:
After you've edited the js-file properly and the TAB section in cartlab-tabs.tpl.
Simply include today_news.tpl in TAB CONTENT.

Example:
BTW "Laatste Nieuws" = Dutch for "Latest News"
http://www.gbhwebsolutions.com/xcart/latestnewsmod.jpg

H.I.H.

Gijs
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
  #2  
Old 04-23-2005, 12:21 AM
 
Online Michael Online Michael is offline
 

eXpert
  
Join Date: Mar 2005
Location: Melbourne, Australia
Posts: 273
 

Default

I'm wondering how this mod could be modified to work with the TAB Menu provided by PhilJ http://forum.x-cart.com/viewtopic.php?t=15428. I have attempted to adapt it Phil's version but I guess I just don't understand PHP, Javascript, and HTML well enough to know how.

Anyone got any ideas?
__________________
X-Cart 5.3.5.4
Reply With Quote
  #3  
Old 04-25-2005, 03:40 AM
 
Online Michael Online Michael is offline
 

eXpert
  
Join Date: Mar 2005
Location: Melbourne, Australia
Posts: 273
 

Default

Got it to work after some foolin around. Good mod for those who are interested.
__________________
X-Cart 5.3.5.4
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:05 PM.

   

 
X-Cart forums © 2001-2020