subversion://[realtgroup-www]/head/WWW/lib/templating.php Log in
ViewVC logotype

Annotate of /head/WWW/lib/templating.php

Parent Directory Parent Directory | Revision Log Revision Log

Revision 3 - (show annotations) (download) (as text)
Mon Jun 11 02:59:39 2007 MSK (10 years, 11 months ago) by vitalif
File MIME type: text/plain; charset=windows-1251
File size: 2270 byte(s)
next

1 <?php
2
3 /***************************************************************************************/
4 /* Создание глобального объекта шаблона и определение наиболее общих его переменных */
5 /* */
6 /* (c) VitaliF 2006-2007 */
7 /***************************************************************************************/
8
9 require_once 'config.php';
10 require_once 'mysql.php';
11 require_once 'structure.php';
12 require_once 'template.php';
13
14 $tpl = config_var('template');
15 if ($tpl == '')
16 $tpl = 'default';
17 $template = new Template ($local_path . $template_path . $tpl);
18 $template -> cachedir = $local_path . $cache_path;
19 $template -> no_pparse = true;
20 $template -> set_filenames (array (
21 'header' => 'all_header.tpl',
22 'footer' => 'all_footer.tpl',
23 ));
24
25 $template -> assign_vars(array(
26 'DOMAIN' => 'http://www.' . $Domain,
27 'ADMIN_EMAIL' => config_var('admin_email'),
28 'SITE_LOGO' => banner ('http://www.' . $Domain . config_var('sitelogo'), config_var('siteinfo'), "http://www.$Domain"),
29 'SITE_INFO/H' => config_var('siteinfo'),
30 'KEYWORDS' => config_var('keywords'),
31 'ADDRESS/H' => config_var('address'),
32 'PHONE/H' => config_var('phone'),
33 ));
34
35 assign_menu ('menu');
36
37 if ($rows = mysql_get_assocs ("SELECT * FROM `$t_news` ORDER BY `date` DESC, `time` DESC, `id` DESC LIMIT ".(0+config_var('left_news_count'))))
38 {
39 foreach ($rows as $row)
40 {
41 $template->assign_block_vars ('lnew', array_merge(process_array($row,'strtoupper','html_strip_pbr'), array (
42 'LINK' => getURL('single', array (t => 'news', id => $row['id'])),
43 'TDATE' => (substr($row['date'],8,2)+0) . ' ' . $months[substr($row['date'],5,2)+0] . ' ' . substr($row['date'],0,4),
44 'FDATE' => mysql_time($row['date'], $row['time'], config_var('date_format')),
45 )));
46 }
47 }
48
49 if ($rows = mysql_get_rows ("SELECT DISTINCT `type` FROM `$t_objects`"))
50 if (count($rows) > 1)
51 foreach ($rows as $row)
52 $template->assign_block_vars('retype', array('NAME' => $ListerConfig['objects']['fields']['type'][1][$row[0]], 'LINK' => getURL('list',array('t' => 'objects', 'type' => $row[0]))));
53
54 ?>