| 31 | | add_event_handler('loc_begin_page_header', 'add_meta' ); |
| | 31 | add_event_handler('loc_begin_page_header', 'add_meta',56 ); |
| | 32 | add_event_handler('loc_begin_page_header', 'add_metacat',61 ); |
| | 33 | add_event_handler('loc_begin_page_header', 'add_metaimg',71 ); |
| | 34 | add_event_handler('loc_after_page_header', 'set_meta_back',81); |
| | 35 | |
| | 45 | $query = ' |
| | 46 | select id,metaname,metaval |
| | 47 | FROM ' . meta_TABLE . ' |
| | 48 | WHERE metaname IN (\'author\', \'keywords\', \'Description\', \'robots\') |
| | 49 | ;'; |
| | 50 | $result = pwg_query($query); |
| | 51 | $meta = array(); |
| | 52 | while ($row = mysql_fetch_assoc($result)) |
| | 53 | { |
| | 54 | $meta[$row['metaname']] = $row['metaval']; |
| | 55 | } |
| | 56 | |
| | 57 | // Authors |
| | 58 | if (!empty($meta_infos['author']) and !empty($meta['author'])) |
| | 59 | { |
| | 60 | $template->assign('INFO_AUTHOR', $meta_infos['author'] . ' - ' . $meta['author']); |
| | 61 | } |
| | 62 | elseif (!empty($meta['author'])) |
| | 63 | { |
| | 64 | $template->assign('INFO_AUTHOR', $meta['author']); |
| | 65 | } |
| | 66 | |
| | 67 | // Keywords |
| | 68 | if (!empty($meta['keywords'])) |
| | 69 | { |
| | 70 | $template->append('related_tags', array('name' => $meta['keywords'])); |
| | 71 | } |
| | 72 | |
| | 73 | // Description |
| | 74 | if (!empty($meta_infos['info']) and !empty($meta['Description'])) |
| | 75 | { |
| | 76 | $template->assign('INFO_FILE', $meta_infos['info'] . ', ' . $meta['Description']); |
| | 77 | } |
| | 78 | elseif (!empty($meta['Description'])) |
| | 79 | { |
| | 80 | $template->assign('INFO_FILE', $meta['Description']); |
| | 81 | } |
| | 82 | |
| | 83 | // Robots |
| | 84 | if (!empty($meta['robots'])) |
| | 85 | { |
| | 86 | $template->append('head_elements', '<meta name="robots" content="'.$meta['robots'].'">'); |
| | 87 | } |
| | 88 | |
| | 89 | } |
| | 90 | function add_metacat() |
| | 91 | { |
| | 92 | global $template, $page, $meta_infos; |
| 41 | | $query = ' |
| 42 | | select id,metaname,metaval |
| 43 | | FROM ' . meta_TABLE . ' |
| 44 | | WHERE metaname IN (\'author\', \'keywords\', \'Description\', \'robots\') |
| 45 | | ;'; |
| 46 | | $result = pwg_query($query); |
| 47 | | $meta = array(); |
| 48 | | while ($row = mysql_fetch_assoc($result)) |
| 49 | | { |
| 50 | | $meta[$row['metaname']] = $row['metaval']; |
| 51 | | } |
| 52 | | |
| 53 | | // Authors |
| 54 | | if (!empty($meta_infos['author']) and !empty($meta['author'])) |
| 55 | | { |
| 56 | | $template->assign('INFO_AUTHOR', $meta_infos['author'] . ' - ' . $meta['author']); |
| 57 | | } |
| 58 | | elseif (!empty($meta['author'])) |
| 59 | | { |
| 60 | | $template->assign('INFO_AUTHOR', $meta['author']); |
| 61 | | } |
| 62 | | |
| 63 | | // Keywords |
| 64 | | if (!empty($meta['keywords'])) |
| 65 | | { |
| 66 | | $template->append('related_tags', array('name' => $meta['keywords'])); |
| 67 | | } |
| 68 | | |
| 69 | | // Description |
| 70 | | if (!empty($meta_infos['info']) and !empty($meta['Description'])) |
| 71 | | { |
| 72 | | $template->assign('INFO_FILE', $meta_infos['info'] . ', ' . $meta['Description']); |
| 73 | | } |
| 74 | | elseif (!empty($meta['Description'])) |
| 75 | | { |
| 76 | | $template->assign('INFO_FILE', $meta['Description']); |
| 77 | | } |
| 78 | | |
| 79 | | // Robots |
| 80 | | if (!empty($meta['robots'])) |
| 81 | | { |
| 82 | | $template->append('head_elements', '<meta name="robots" content="'.$meta['robots'].'">'); |
| 83 | | } |
| 84 | | |
| 85 | | //meta categories |
| | 100 | //meta categories |