<!--~~form start~~--><!--~form start~-->
<h2><!--~opt_db_1 start~--><!--~~new_msg start~~-->Add a new entry<!--~~end~~--><!--~~edit_msg start~~-->Edit entry "~~name.html~~"<!--~~end~~--><!--~end~--><!--~opt_db_1_else start~-->~form_name~ entry form<!--~end~--></h2>
- <!--~error start~--><div class="error"><h3>~error_message.html~</h3></div><!--~end~-->
+ <!--~~message_container start~~-->
+ <div style="border: 2px solid red; background: #fbb; padding: 5px; margin: 20px 0px">
+ <!--~~message_box start~~-->
+ <!--~~message_divider start~~-->
+ <hr />
+ <!--~~end~~-->
+ <p style="font-size: 120%; padding: 5px; margin: 0px">~~message_text.html~~</p>
+ <!--~~end~~-->
+ </div>
+ <!--~~end~~-->
<form action="~form_name~.html~enctype_attr~" method="post"><!--~opt_db_2 start~--><!--~~editing start~~--><input type="hidden" name="~form_name~_edit_id" value="~~~form_name~_edit_id.attr~~" /><!--~~end~~--><!--~end~--><!--~uploads start~--><input type="hidden" name="MAX_FILE_SIZE" value="~~upload_max_filesize~~" /><!--~end~-->
<table cellspacing="0" cellpadding="4" border="0" summary=""><!--~row start~-->
$cc = '';
$bcc = '';
if(email($from, $to, $subject, $message, $cc, $bcc)) {
- tem_set('error_message', 'Due to an internal error, your message could not be sent. Please try again later.');
- tem_sub('error');
+ message('Due to an internal error, your message could not be sent. Please try again later.');
$error = true;
}
}<!--~end~-->
tem_set('upload_max_filesize', upload_max_filesize());<!--~end~-->
+ display_messages();
tem_sub('form');
}
# Run the template. Pass a filename, or a string, unless you've already
# specified a template with load()
function run($templ = false) {
+ $template_string = $this->template;
+ $template_file = $this->file;
if($templ !== false) {
if(strlen($templ) < 150 && file_exists($templ)) {
- $this->filename = $templ;
- unset($this->template);
+ $template_file = $templ;
+ unset($template_string);
} else {
- $this->template = $templ;
+ $template_string = $templ;
}
}
- if(!$this->template) {
- if(!$this->filename) {
+ if(!$template_string) {
+ if(!$template_file) {
print "sorry, no template to run\n";
exit(1);
}
- $this->template = read_whole_file($this->filename);
+ $template_string = read_whole_file($template_file);
}
return template_run($this->template, $this->keyval);