[ Index ] |
PHP Cross Reference of osCMax 2.0.4 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 $Id: article_header_tags.php 3 2006-05-27 04:59:07Z user $ 4 5 osCMax Power E-Commerce 6 http://oscdox.com 7 8 Copyright 2006 osCMax 9 10 Released under the GNU General Public License 11 */ 12 13 // Modification of Header Tags Contribution 14 // WebMakers.com Added: Header Tags Generator v2.0 15 16 require(DIR_WS_LANGUAGES . $language . '/' . 'article_header_tags.php'); 17 18 echo '<meta name="reply-to" content="' . HEAD_REPLY_TAG_ALL . '">' . "\n"; 19 20 $the_desc=''; 21 $the_key_words=''; 22 $the_title=''; 23 24 // Define specific settings per page: 25 switch (true) { 26 27 // ARTICLES.PHP 28 case ((strstr($_SERVER['PHP_SELF'],'articles.php') or strstr($PHP_SELF,'articles.php')) &! strstr($PHP_SELF,'new_articles.php')): 29 $the_topic_query = tep_db_query("select td.topics_name from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.topics_id = '" . (int)$current_topic_id . "' and td.topics_id = '" . (int)$current_topic_id . "' and td.language_id = '" . (int)$languages_id . "'"); 30 $the_topic = tep_db_fetch_array($the_topic_query); 31 32 $the_authors_query= tep_db_query("select authors_name from " . TABLE_AUTHORS . " where authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "'"); 33 $the_authors = tep_db_fetch_array($the_authors_query); 34 35 if (HTDA_ARTICLES_ON=='1') { 36 $the_desc= HEAD_DESC_TAG_ARTICLES . '. ' . HEAD_DESC_TAG_ALL; 37 } else { 38 $the_desc= HEAD_DESC_TAG_ARTICLES; 39 } 40 41 if (HTKA_ARTICLES_ON=='1') { 42 43 if (tep_not_null($the_topic['topics_name'])) { 44 $the_key_words .= $the_topic['topics_name']; 45 } else { 46 if (tep_not_null($the_authors['authors_name'])) { 47 $the_key_words .= $the_authors['authors_name']; 48 } 49 } 50 51 $the_key_words = HEAD_KEY_TAG_ARTICLES . ', ' . $the_key_words . ', ' . HEAD_KEY_TAG_ALL; 52 53 } else { 54 $the_key_words= HEAD_KEY_TAG_ARTICLES; 55 } 56 57 if (HTTA_ARTICLES_ON=='1') { 58 $the_title= HEAD_TITLE_TAG_ALL . ' - ' . HEAD_TITLE_TAG_ARTICLES; 59 60 if (tep_not_null($the_topic['topics_name'])) { 61 $the_title .= ' - ' . $the_topic['topics_name']; 62 } else { 63 if (tep_not_null($the_authors['authors_name'])) { 64 $the_title .= TEXT_BY . $the_authors['authors_name']; 65 } 66 } 67 68 } else { 69 $the_title= HEAD_TITLE_TAG_ARTICLES; 70 } 71 72 break; 73 74 // ARTICLE_INFO.PHP 75 case ( strstr($_SERVER['PHP_SELF'],'article_info.php') or strstr($PHP_SELF,'article_info.php') ): 76 $the_article_info_query = tep_db_query("select a.articles_id, ad.articles_name, ad.articles_description, ad.articles_head_title_tag, ad.articles_head_keywords_tag, ad.articles_head_desc_tag, ad.articles_url, a.articles_date_added, a.articles_date_available, a.authors_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_id = '" . $HTTP_GET_VARS['articles_id'] . "' and ad.articles_id = '" . $HTTP_GET_VARS['articles_id'] . "'"); 77 $the_article_info_query = tep_db_query("select ad.language_id, a.articles_id, ad.articles_name, ad.articles_description, ad.articles_head_title_tag, ad.articles_head_keywords_tag, ad.articles_head_desc_tag, ad.articles_url, a.articles_date_added, a.articles_date_available, a.authors_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and ad.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "'" . " and ad.language_id ='" . (int)$languages_id . "'"); 78 $the_article_info = tep_db_fetch_array($the_article_info_query); 79 80 if (empty($the_article_info['articles_head_desc_tag'])) { 81 $the_desc= NAVBAR_TITLE . '. ' . HEAD_DESC_TAG_ALL; 82 } else { 83 if ( HTDA_ARTICLE_INFO_ON=='1' ) { 84 $the_desc= $the_article_info['articles_head_desc_tag'] . ' ' . HEAD_DESC_TAG_ALL; 85 } else { 86 $the_desc= $the_article_info['articles_head_desc_tag']; 87 } 88 } 89 90 if (empty($the_article_info['articles_head_keywords_tag'])) { 91 $the_key_words= NAVBAR_TITLE . ', ' . HEAD_KEY_TAG_ALL; 92 } else { 93 if ( HTKA_ARTICLE_INFO_ON=='1' ) { 94 $the_key_words= $the_article_info['articles_head_keywords_tag'] . ', ' . HEAD_KEY_TAG_ALL; 95 } else { 96 $the_key_words= $the_article_info['articles_head_keywords_tag']; 97 } 98 } 99 100 if (empty($the_article_info['articles_head_title_tag'])) { 101 $the_title= HEAD_TITLE_TAG_ALL . ' - ' . NAVBAR_TITLE; 102 } else { 103 if ( HTTA_ARTICLE_INFO_ON=='1' ) { 104 $the_title= HEAD_TITLE_TAG_ALL . ' - ' . HEAD_TITLE_TAG_ARTICLE_INFO . ' - ' . $topics['topics_name'] . $authors['authors_name'] . ' - ' . clean_html_comments($the_article_info['articles_head_title_tag']); 105 } else { 106 $the_title= clean_html_comments($the_article_info['articles_head_title_tag']); 107 } 108 } 109 110 break; 111 112 // ARTICLES_NEW.PHP 113 case ( strstr($_SERVER['PHP_SELF'],'articles_new.php') or strstr($PHP_SELF,'articles_new.php') ): 114 if ( HEAD_DESC_TAG_ARTICLES_NEW!='' ) { 115 if ( HTDA_ARTICLES_NEW_ON=='1' ) { 116 $the_desc= HEAD_DESC_TAG_ARTICLES_NEW . '. ' . HEAD_DESC_TAG_ALL; 117 } else { 118 $the_desc= HEAD_DESC_TAG_ARTICLES_NEW; 119 } 120 } else { 121 $the_desc= NAVBAR_TITLE . '. ' . HEAD_DESC_TAG_ALL; 122 } 123 124 if ( HEAD_KEY_TAG_ARTICLES_NEW=='' ) { 125 // Build a list of ALL new article names to put in keywords 126 $articles_new_array = array(); 127 $articles_new_query_raw = "select ad.articles_name from " . TABLE_ARTICLES . " a left join " . TABLE_AUTHORS . " au on (a.authors_id = au.authors_id), " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' order by a.articles_date_added DESC, ad.articles_name"; 128 $articles_new_split = new splitPageResults($articles_new_query_raw, MAX_NEW_ARTICLES_PER_PAGE); 129 $articles_new_query = tep_db_query($articles_new_split->sql_query); 130 131 $row = 0; 132 $the_new_articles=''; 133 while ($articles_new = tep_db_fetch_array($articles_new_query)) { 134 $the_new_articles .= clean_html_comments($articles_new['articles_name']) . ', '; 135 } 136 if ( HTKA_ARTICLES_NEW_ON=='1' ) { 137 $the_key_words= NAVBAR_TITLE . ', ' . $the_new_articles . ', ' . HEAD_KEY_TAG_ALL; 138 } else { 139 $the_key_words= NAVBAR_TITLE . ', ' . $the_new_articles; 140 } 141 } else { 142 $the_key_words= HEAD_KEY_TAG_ARTICLES_NEW . ', ' . HEAD_KEY_TAG_ALL; 143 } 144 145 if ( HEAD_TITLE_TAG_ARTICLES_NEW!='' ) { 146 if ( HTTA_ARTICLES_NEW_ON=='1' ) { 147 $the_title= HEAD_TITLE_TAG_ALL . ' - ' . HEAD_TITLE_TAG_ARTICLES_NEW; 148 } else { 149 $the_title= HEAD_TITLE_TAG_ARTICLES_NEW; 150 } 151 } else { 152 $the_title= HEAD_TITLE_TAG_ALL . ' - ' . NAVBAR_TITLE; 153 } 154 155 break; 156 157 // ARTICLES_REVIEWS_INFO.PHP and ARTICLES_REVIEWS.PHP 158 case ( strstr($_SERVER['PHP_SELF'],'article_reviews_info.php') or strstr($_SERVER['PHP_SELF'],'article_reviews.php') or strstr($PHP_SELF,'article_reviews_info.php') or strstr($PHP_SELF,'article_reviews.php') ): 159 if ( HEAD_DESC_TAG_ARTICLE_REVIEWS_INFO=='' ) { 160 if ( HTDA_ARTICLE_REVIEWS_INFO_ON=='1' ) { 161 $the_desc= NAVBAR_TITLE . '. ' . tep_get_header_tag_articles_desc(isset($HTTP_GET_VARS['reviews_id'])) . ' ' . HEAD_DESC_TAG_ALL; 162 } else { 163 $the_desc= NAVBAR_TITLE . '. ' . tep_get_header_tag_articles_desc(isset($HTTP_GET_VARS['reviews_id'])); 164 } 165 } else { 166 $the_desc= HEAD_DESC_TAG_ARTICLE_REVIEWS_INFO; 167 } 168 169 if ( HEAD_KEY_TAG_ARTICLE_REVIEWS_INFO=='' ) { 170 if ( HTKA_ARTICLE_REVIEWS_INFO_ON=='1' ) { 171 $the_key_words= NAVBAR_TITLE . ', ' . tep_get_header_tag_articles_keywords(isset($HTTP_GET_VARS['reviews_id'])) . ', ' . HEAD_KEY_TAG_ALL; 172 } else { 173 $the_key_words= NAVBAR_TITLE . ', ' . tep_get_header_tag_articles_keywords(isset($HTTP_GET_VARS['reviews_id'])); 174 } 175 } else { 176 $the_key_words= HEAD_KEY_TAG_ARTICLE_REVIEWS_INFO; 177 } 178 179 if ( HEAD_TITLE_TAG_ARTICLE_REVIEWS_INFO=='' ) { 180 if ( HTTA_ARTICLE_REVIEWS_INFO_ON=='1' ) { 181 $the_title= HEAD_TITLE_TAG_ALL . ' - ' . HEADING_TITLE . tep_get_header_tag_articles_title(isset($HTTP_GET_VARS['reviews_id'])); 182 } else { 183 $the_title= tep_get_header_tag_articles_title(isset($HTTP_GET_VARS['reviews_id'])); 184 } 185 } else { 186 $the_title= HEAD_TITLE_TAG_ARTICLE_REVIEWS_INFO; 187 } 188 189 break; 190 191 // ALL OTHER PAGES NOT DEFINED ABOVE 192 default: 193 $the_desc= NAVBAR_TITLE . '. ' . HEAD_DESC_TAG_ALL; 194 $the_key_words= NAVBAR_TITLE . ', ' . HEAD_KEY_TAG_ALL; 195 $the_title= HEAD_TITLE_TAG_ALL . ' - ' . NAVBAR_TITLE; 196 break; 197 198 } 199 200 echo '<meta name="description" content="' . $the_desc . '">' . "\n"; 201 echo '<meta name="keywords" content="' . $the_key_words . '">' . "\n"; 202 echo '<title>' . $the_title . '</title>' . "\n"; 203 204 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Jan 1 13:43:16 2010 | Cross-referenced by PHPXref 0.7 |