Zeile 34 | Zeile 34 |
---|
/** * Cache the templates. *
|
/** * Cache the templates. *
|
* @param string A list of templates to cache.
| * @param string $templates A list of templates to cache.
|
*/ function cache($templates) {
| */ function cache($templates) {
|
Zeile 46 | Zeile 46 |
---|
$sql .= " ,'".trim($title)."'"; }
|
$sql .= " ,'".trim($title)."'"; }
|
$query = $db->simple_select("templates", "title,template", "title IN (''$sql) AND sid IN ('-2','-1','".$theme['templateset']."')", array('order_by' => 'sid', 'order_dir' => 'asc'));
| $query = $db->simple_select("templates", "title,template", "title IN (''$sql) AND sid IN ('-2','-1','".(int)$theme['templateset']."')", array('order_by' => 'sid', 'order_dir' => 'asc'));
|
while($template = $db->fetch_array($query)) { $this->cache[$template['title']] = $template['template'];
| while($template = $db->fetch_array($query)) { $this->cache[$template['title']] = $template['template'];
|
Zeile 56 | Zeile 56 |
---|
/** * Gets templates. *
|
/** * Gets templates. *
|
* @param string The title of the template to get. * @param boolean True if template contents must be escaped, false if not. * @param boolean True to output HTML comments, false to not output.
| * @param string $title The title of the template to get. * @param boolean|int $eslashes True if template contents must be escaped, false if not. * @param boolean|int $htmlcomments True to output HTML comments, false to not output.
|
* @return string The template HTML. */ function get($title, $eslashes=1, $htmlcomments=1)
| * @return string The template HTML. */ function get($title, $eslashes=1, $htmlcomments=1)
|
Zeile 86 | Zeile 86 |
---|
} else {
|
} else {
|
$query = $db->simple_select("templates", "template", "title='".$db->escape_string($title)."' AND sid IN ('-2','-1','".$theme['templateset']."')", array('order_by' => 'sid', 'order_dir' => 'DESC', 'limit' => 1));
| $query = $db->simple_select("templates", "template", "title='".$db->escape_string($title)."' AND sid IN ('-2','-1','".(int)$theme['templateset']."')", array('order_by' => 'sid', 'order_dir' => 'DESC', 'limit' => 1));
|
}
$gettemplate = $db->fetch_array($query);
| }
$gettemplate = $db->fetch_array($query);
|
Zeile 95 | Zeile 95 |
---|
$this->uncached_templates[$title] = $title; }
|
$this->uncached_templates[$title] = $title; }
|
if(!$gettemplate)
| if(empty($gettemplate))
|
{
|
{
|
$gettemplate['template'] = "";
| $gettemplate = array('template' => '');
|
}
$this->cache[$title] = $gettemplate['template']; } $template = $this->cache[$title];
|
}
$this->cache[$title] = $gettemplate['template']; } $template = $this->cache[$title];
|
if($htmlcomments)
| if($htmlcomments && $template !== false)
|
{ if($mybb->settings['tplhtmlcomments'] == 1) {
| { if($mybb->settings['tplhtmlcomments'] == 1) {
|
Zeile 126 | Zeile 126 |
---|
/** * Prepare a template for rendering to a variable. *
|
/** * Prepare a template for rendering to a variable. *
|
* @param string The name of the template to get. * @param boolean True if template contents must be escaped, false if not. * @param boolean True to output HTML comments, false to not output.
| * @param string $template The name of the template to get. * @param boolean $eslashes True if template contents must be escaped, false if not. * @param boolean $htmlcomments True to output HTML comments, false to not output.
|
* @return string The eval()-ready PHP code for rendering the template */ function render($template, $eslashes=true, $htmlcomments=true)
| * @return string The eval()-ready PHP code for rendering the template */ function render($template, $eslashes=true, $htmlcomments=true)
|
Zeile 138 | Zeile 138 |
---|
/** * Fetch a template directly from the install/resources/mybb_theme.xml directory if it exists (DEVELOPMENT MODE)
|
/** * Fetch a template directly from the install/resources/mybb_theme.xml directory if it exists (DEVELOPMENT MODE)
|
| * * @param string $title * @return string|bool
|
*/ function dev_get($title) {
| */ function dev_get($title) {
|