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

Simple Newsarchive for Customers
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 01-24-2004, 01:02 PM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default Simple Newsarchive for Customers

This is a simple mod so customers can see what information could be sent to them when they subscribe, and to keep an archive handy for them as well.

This mod will display newsletters SENT only, and limited to the recent 10 newsletters, but you can change it easily inside the script.

Step 1:
Create 3 language label variables:
lbl_newsarchive = News Archive
lbl_newsarchive_none = No Newsletters have been sent
lbl_newsarchive_published = Published

Step 2:
Create a file called newsarchive.php and save it in your /customer directory, with the following code in it:
Code:
<?php # # $Id: newsarchive.php,v 1.0 2004/01/24 08:00:00 leon Exp $ # News Archive # require "./auth.php"; require $xcart_dir."/include/categories.php"; if($active_modules["Bestsellers"]) include "../modules/Bestsellers/bestsellers.php"; # # Get Newsletters that have been sent and store it into $newsarchive array # $newsarchive = func_query("SELECT newsid, subject, body, send_date, status FROM $sql_tbl[newsletter] WHERE status='S' ORDER BY send_date DESC LIMIT 0, 10"); if (count($newsarchive) ==0) $newsarchive=""; $smarty->assign("newsarchive",$newsarchive); $smarty->assign("main","newsarchive"); $smarty->display("customer/home.tpl"); ?>

Note: Notice the DESC LIMIT 0,10, this is where you limit the max amount of archived newsletters to display, you can fix the 10 to whatever number you like.

Step 3:
In your /skin1/common_templates.tpl file add this line:
Code:
{elseif $main eq "newsarchive"} {include file="customer/newsarchive.tpl"}

Step 4:
In your /skin1/today_news.tpl file add this after {$lng.txt_today_news}:
Code:
{if $usertype eq "C"} <center>[ {$lng.lbl_newsarchive} ]</center> {/if}

Step 5:
Create a file under /skin1/customer named newsarchive.tpl with the following code in it:
Code:
{* $Id: newsarchive.tpl,v 1.0 2004/01/24 08:00:00 leon Exp $ *} {capture name=newsarchive} {if $newsarchive} {section name=num loop=$newsarchive} <table width=100% border=0 cellspacing=0 cellpadding=2> <tr> <td>{$newsarchive[num].subject} [ {$lng.lbl_newsarchive_published}: {$newsarchive[num].send_date|date_format:$config.Appearance.date_format} ]</td> </tr> <tr> <td>{$newsarchive[num].body}</td> </tr> </table> <HR> {/section} {else} {$lng.lbl_newsarchive_none} {/if} {/capture} {include file="dialog.tpl" title=$lng.lbl_newsarchive content=$smarty.capture.newsarchive extra="width=100%"}

Thats all, simple and directly let your customers see what kind of information you send out on your newsletters.
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #2  
Old 06-07-2005, 04:12 PM
 
tcrescibene tcrescibene is offline
 

Newbie
  
Join Date: May 2005
Posts: 4
 

Default Thanks

Leon,

Thanks for the info. Do you have this running anywhere so I can see it running?
__________________
4.013
Reply With Quote
  #3  
Old 06-22-2005, 05:14 AM
  DataViking's Avatar 
DataViking DataViking is offline
 

eXpert
  
Join Date: Jan 2003
Location: Las Vegas, NV
Posts: 361
 

Default

thank you, I will try it today
__________________
Web Design Web Design and Custom X-Cart Projects

http://www.dataviking.com

Mention the forums for discounts!
x-cart Version 4.1.8
Reply With Quote
  #4  
Old 06-22-2005, 05:23 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

This is a very old post, so be careful implementing it into version 4.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 06-22-2005, 03:50 PM
  DataViking's Avatar 
DataViking DataViking is offline
 

eXpert
  
Join Date: Jan 2003
Location: Las Vegas, NV
Posts: 361
 

Default

thank you I will
__________________
Web Design Web Design and Custom X-Cart Projects

http://www.dataviking.com

Mention the forums for discounts!
x-cart Version 4.1.8
Reply With Quote
  #6  
Old 06-24-2005, 01:58 PM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default Re: Thanks

Quote:
Originally Posted by tcrescibene
Leon,

Thanks for the info. Do you have this running anywhere so I can see it running?

Read my footer -> dmcigars.com
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


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 02:42 AM.

   

 
X-Cart forums © 2001-2018