minor tweaks

This commit is contained in:
pete_morgan
2006-02-17 22:19:14 +00:00
parent 00e211c1f8
commit 7a44764759
9 changed files with 30 additions and 22 deletions

View File

@@ -85,7 +85,8 @@
</programlisting>
</example>
<para>
You can also pass variables to included templates as attributes.
You can also pass variables to included templates as
<link linkend="language.syntax.attributes">attributes</link>.
Any variables explicitly passed to an included template as
attributes are only available within the scope of the included
file. Attribute variables override current template variables, in
@@ -170,6 +171,7 @@
<para>
See also
<link linkend="language.function.include.php">{include_php}</link>,
<link linkend="language.function.insert.php">{insert}</link>,
<link linkend="language.function.php">{php}</link>,
<link linkend="template.resources">Template Resources</link> and
<link linkend="tips.componentized.templates">Componentized Templates</link>.

View File

@@ -106,7 +106,7 @@
script must be included first to make it work. The path can be
either absolute, or relative to
<link linkend="variable.trusted.dir">$trusted_dir</link>. When <link
linkend="variable.security">security is enabled</link>, the script
linkend="variable.security">$security</link> is enabled, the script
must reside in <link linkend="variable.trusted.dir">$trusted_dir</link>.
</para>
<para>
@@ -125,6 +125,10 @@
weather, search results, user feedback areas, etc.
</para>
</note>
<para>
See also
<link linkend="language.function.include">{include}</link>
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:

View File

@@ -6,9 +6,9 @@
{ldelim} and {rdelim} are used for
<link linkend="language.escaping">escaping</link>
template delimiters, by default
"{" or "}". You can also use <link
"{" and "}". You can also use <link
linkend="language.function.literal">{literal}{/literal}</link> to escape
blocks of text.
blocks of text eg Javascript or css.
See also <link
linkend="language.variables.smarty.ldelim">{$smarty.ldelim}</link>.
</para>

View File

@@ -47,7 +47,8 @@
See also
<link linkend="variable.php.handling">$php_handling</link>,
<link linkend="language.function.include.php">{include_php}</link>,
<link linkend="language.function.include">{include}</link> and
<link linkend="language.function.include">{include}</link>,
<link linkend="language.function.insert">{insert}</link> and
<link linkend="tips.componentized.templates">Componentized Templates</link>.
</para>
</sect1>

View File

@@ -67,7 +67,7 @@ function mysql_cache_handler($action, &$smarty_obj, &$cache_content, $tpl_file=n
$CacheID = md5($tpl_file.$cache_id.$compile_id);
if(! $link = mysql_pconnect($db_host, $db_user, $db_pass)) {
$smarty_obj->_trigger_error_msg("cache_handler: could not connect to database");
$smarty_obj->_trigger_error_msg('cache_handler: could not connect to database');
return false;
}
mysql_select_db($db_name);
@@ -77,14 +77,14 @@ function mysql_cache_handler($action, &$smarty_obj, &$cache_content, $tpl_file=n
// read cache from database
$results = mysql_query("select CacheContents from CACHE_PAGES where CacheID='$CacheID'");
if(!$results) {
$smarty_obj->_trigger_error_msg("cache_handler: query failed.");
$smarty_obj->_trigger_error_msg('cache_handler: query failed.');
}
$row = mysql_fetch_array($results,MYSQL_ASSOC);
if($use_gzip && function_exists("gzuncompress")) {
$cache_content = gzuncompress($row["CacheContents"]);
if($use_gzip && function_exists('gzuncompress')) {
$cache_content = gzuncompress($row['CacheContents']);
} else {
$cache_content = $row["CacheContents"];
$cache_content = $row['CacheContents'];
}
$return = $results;
break;
@@ -102,7 +102,7 @@ function mysql_cache_handler($action, &$smarty_obj, &$cache_content, $tpl_file=n
'".addslashes($contents)."')
");
if(!$results) {
$smarty_obj->_trigger_error_msg("cache_handler: query failed.");
$smarty_obj->_trigger_error_msg('cache_handler: query failed.');
}
$return = $results;
break;
@@ -110,12 +110,12 @@ function mysql_cache_handler($action, &$smarty_obj, &$cache_content, $tpl_file=n
// clear cache info
if(empty($cache_id) && empty($compile_id) && empty($tpl_file)) {
// clear them all
$results = mysql_query("delete from CACHE_PAGES");
$results = mysql_query('delete from CACHE_PAGES');
} else {
$results = mysql_query("delete from CACHE_PAGES where CacheID='$CacheID'");
}
if(!$results) {
$smarty_obj->_trigger_error_msg("cache_handler: query failed.");
$smarty_obj->_trigger_error_msg('cache_handler: query failed.');
}
$return = $results;
break;

View File

@@ -8,7 +8,7 @@
<link linkend="language.function.include">{include}</link>
and <link linkend="language.function.fetch">{fetch}</link>
use this when
<link linkend="variable.security">security is enabled</link>.
<link linkend="variable.security">$security</link> is enabled.
</para>
<para>
See also

View File

@@ -4,7 +4,7 @@
<title>$security_settings</title>
<para>
These are used to override or specify the security settings when
<link linkend="variable.security">security is enabled</link>.
<link linkend="variable.security">$security</link> is enabled.
These are the possible settings:
</para>
<itemizedlist>
@@ -18,7 +18,7 @@ These are the possible settings:
<listitem>
<para>
IF_FUNCS - This is an array of the names of permitted PHP functions in
<link linkend="language.function.if">IF</link> statements.
<link linkend="language.function.if">{if}</link> statements.
</para>
</listitem>
<listitem>

View File

@@ -39,10 +39,11 @@ $smarty->caching = true;
function remaining_seconds($params, &$smarty) {
$remain = $params['endtime'] - time();
if ($remain >=0)
return $remain . " second(s)";
else
return "done";
if($remain >= 0){
return $remain . ' second(s)';
}else{
return 'done';
}
}
$smarty->register_function('remaining', 'remaining_seconds', false, array('endtime'));

View File

@@ -3,7 +3,7 @@
<sect1 id="plugins.inserts"><title>Inserts</title>
<para>
Insert plugins are used to implement functions that are invoked by
<link linkend="language.function.insert"><command>insert</command></link>
<link linkend="language.function.insert">{insert}</link>
tags in the template.
</para>
<funcsynopsis>
@@ -19,7 +19,7 @@
</para>
<para>
The insert function is supposed to return the result which will be
substituted in place of the <command>insert</command> tag in the
substituted in place of the <command>{insert}</command> tag in the
template.
</para>
<example>