Hi pmstudios,
Couldn't sleep so back to work
So here it goes:
pages.php
Code:
<?php
#
# $Id: pages.php,v 1.1 2004/06/24 13:30:57 max Exp $
#
# This script show static page in customer zone
require "./auth.php";
require $xcart_dir."/include/categories.php";
if($active_modules["Manufacturers"])
include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php";
$pages_dir = $smarty->template_dir."/pages/$store_language/";
if (isset($HTTP_GET_VARS["pageid"])) {
#
# Prepare data for editing
#
$preview = ($mode=="preview" ? "" : "AND active='Y'");
$page_data = func_query_first("SELECT filename, title FROM $sql_tbl[pages] WHERE pageid='$pageid' $preview AND level='E'");
if ($page_data) {
$filename = $pages_dir.$page_data["filename"];
$page_content = func_file_get($filename, true);
if ($page_content === false) {
$page_content = "Page didn't found";
}
$smarty->assign("page_data", $page_data);
$smarty->assign("page_content", $page_content);
$location[] = array($page_data["title"], "");
}
else {
func_header_location("error_message.php?page_not_found");
}
}
$smarty->assign("main", "pages");
#
# Prepare list of all available Embedded pages for the current language
#
$pages = func_query("SELECT pageid, title FROM $sql_tbl[pages] WHERE active='Y' AND level='E' AND language='$store_language' ORDER BY orderby ASC");
$smarty->assign("pages", $pages);
# Assign the current location line
$smarty->assign("location", $location);
func_display("customer/home.tpl",$smarty);
?>
costumer/main/pages.tpl
Code:
{* $Id: pages.tpl,v 1.3 2004/05/06 11:40:19 svowl Exp $ *}
{include file="customer/main/pages_title.tpl"}
{if $page_content ne ""}
{capture name=dialog}
{if $config.General.parse_smarty_tags eq "Y"}
{eval var=$page_content}
{else}
{$page_content}
{/if}
{/capture}
{include file="dialog.tpl" title=$page_data.title content=$smarty.capture.dialog extra="width=100%"}
{/if}
customer/main/pages_title.tpl
Code:
<table width="100%">
<tr>
<td align="center"><h1>How To Zone ==>change into $lng</h1></td>
</tr>
<tr>
<td>Blablabla ==> change into $lng
</td>
</tr>
</table>
{capture name=dialog}
{if $pages}
{section name=id loop=$pages}
{$pages[id].title}
{/section}
{else}
No pages available
{/if}
{/capture}
{include file="dialog.tpl" title="How To ? ==> change into lng-variable" content=$smarty.capture.dialog extra="width=100%"}
Works fine for me
Have a good night to ...
Gijs