View Single Post
  #5  
Old 10-24-2004, 09:28 AM
 
pmstudios pmstudios is offline
 

Senior Member
  
Join Date: May 2004
Posts: 133
 

Default

You'll have to setup a template page to display the list of pages, but here is the modification for pages.php

Code:
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"); } } else { $pages = func_query("SELECT pageid, title FROM $sql_tbl[pages] WHERE language='$store_language' AND active='Y' ORDER BY orderby ASC"); $smarty->assign("pages", $pages); } $smarty->assign("main", "pages"); # Assign the current location line $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); ?>

Add the following to the top of customer/main/pages.tpl
Code:
{include file="customer/main/pages_title.tpl"}

Create new template file customer/main/pages_title.tpl
Code:
{capture name=dialog} {if $pages} {section name=id loop=$pages} {$pages[id].title} {/section} {else} {$lng.txt_no_pages_available} {/if} {/capture} {include file="dialog.tpl" title=$page_data.title content=$smarty.capture.dialog extra="width=100%"}

And of course whatever message you want for txt_no_pages_available, like "There are currently no pages available" or whatever you want.

This is really off the top of my head, so backup your files! I haven't tested it either, but hopefully it works or sets you in the right direction.
__________________
X-Cart 4.0.5
MySQL: 3.23.58
PHP 4.3.2
Reply With Quote