View Single Post
Old 06-03-2004, 01:33 PM   #7
jclabaugh
Green Mole
 
Join Date: Jun 2004
Posts: 3
Charter:

I followed your code above, modifying search_function.php and the template. I included a header and footer file.

My scripts
search_function.php
Code:
I added to the top:
function get_my_includes($filename) {
  if (file_exists($filename)) {
  $buffer = "";
  $handle = fopen($filename, "r");
  while (!feof($handle)) {
    $buffer .= fgets($handle, 4096);
  }
  fclose ($handle);
  return $buffer;
 }
}
I modified the later bits as such.
Code:
$my_page_header = get_my_includes("./includes/header_aux.inc.php");
$my_page_footer = get_my_includes("./includes/footer_aux.inc.php");

if ($template == 'array' || is_file($template)) {
    $phpdig_version = PHPDIG_VERSION;
    $t_mstrings = compact('my_page_header','my_page_footer','powered_by_link','title_message','phpdig_version','result_message','nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','next_link','templates_links');
    $t_fstrings = phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'template',$template);
    if ($template == 'array') {
        return array_merge($t_mstrings,$t_fstrings,array('results'=>$table_results));
    }
    else {
        $t_strings = array_merge($t_mstrings,$t_fstrings);
        phpdigParseTemplate($template,$t_strings,$table_results);
    }
}
And to the template I added:
Code:
<phpdig:my_page_header/>
<phpdig:my_page_footer/>
No problems, except the included files aren't being parsed, just included as code. Any ideas on how to get these included files to parse?

Cheers,

JC
jclabaugh is offline   Reply With Quote