Author Topic: Integration into website using Smarty templates  (Read 1433 times)

AlanT

  • Posts: 47
    • View Profile
    • http://www.PowerKeysPub.com
Integration into website using Smarty templates
« on: September 22, 2005, 02:19:54 pm »
I have a question that doesn't seem to have an answer on the forums yet.

I've recently rebuilt my main site using X-Cart, which uses Smarty templates to dynamically build the site pages as they are requested by site visitors.

Is it possible to integrate the signup confirmation pages and such into the rest of the site so that the dynamic content is displayed on the same pages as the custom HTML from LMP?

Seems to me that if the Smarty templates include the LM php files, it should work as long as the custom HTML leaves out the <head></head> and <body></body> tags.

Does anyone know if this will work?
- Alan

We all have the Power.
All we need are the Keys.
http://www.PowerKeysPub.com

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Integration into website using Smarty templates
« Reply #1 on: September 25, 2005, 02:07:59 pm »
I believe this is possible with the included signup-xtra.php script.  With this script you can run Custom PHP/HTML at signup and optionally during manual addition and import.  You can even create a new database connection.  The only problem is that message codes cannot be used - you need to use the provided variables and/or your own PHP code instead.  You know.. we may even be able to use message codes with processmsg but it requires a small modification to ListMail to make sure the $userid variable is available with manual signup and import.

To enable signup-xtra.php, move it to the ListMail folder.  Some (incomplete) code such as follows should work:

Code: [Select]

// only run for list 1
if($list=='1'){
 // connect to db2
 $link2 = mysql_connect...
 // get db data
 list($data,data2)=mysql_fetch_row(mysql_query("... where email like '$email' or uid = '$uid'",$link2));
 echo "<html>
<head></head>
<body>
Hi $email!, you're now a member AND a subscriber! :-)<br>
<br>
member username: $data<br>
member password: $data2<br>
<br>
</body>
</html>";
 exit;
}

The exit; call is important, but could mess things up during manual signup/import.. let me know if it's a problem.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting