PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/sfb/header.php

https://github.com/n3u/n3u-Niche-Store
PHP | 381 lines | 359 code | 1 blank | 21 comment | 50 complexity | 73074cbede3689a7ab5b87659b2afbaa MD5 | raw file
  1. <?php
  2. /**
  3. n3u Niche Store - Custom Niche PHP Script
  4. Copyright (C) 2012-2014 n3u.com
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>
  15. **/
  16. if(!defined('n3u')){die('Direct access is not permitted.');} // Is n3u defined?
  17. switch($n3u_inputVars['x']){
  18. case "download":
  19. case "feed":
  20. case "go":
  21. // do nothing
  22. break;
  23. case "admin": // If Admin, do this
  24. echo '<!DOCTYPE html>' . PHP_EOL
  25. . '<html>' . PHP_EOL
  26. . "\t" . '<head>' . PHP_EOL
  27. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  28. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  29. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  30. . "\t\t" . '<meta name="description" content="This page controls all the main settings for n3u Niche Store as well as displays admin-based blocks.">' . PHP_EOL;
  31. if(isset($n3u_PostVars) && $n3u_PostVars != NULL){
  32. echo "\t\t" . '<meta http-equiv="refresh" content="0">' . PHP_EOL;
  33. }
  34. echo "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL
  35. . "\t\t" . '<title>' . $n3u_lang['Admin_Panel'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  36. n3u_CacheCSS();
  37. n3u_CacheJS();
  38. echo "\t" . '</head>' . PHP_EOL
  39. . "\t" . '<body>' . PHP_EOL
  40. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  41. . "\t\t\t" . '<div id="header">' . PHP_EOL
  42. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  43. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  44. . "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  45. n3u_Block('header');
  46. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  47. break;
  48. case "contact": // If contact, do this
  49. echo '<!DOCTYPE html>' . PHP_EOL
  50. . '<html>' . PHP_EOL
  51. . "\t" . '<head>' . PHP_EOL
  52. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  53. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  54. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  55. . "\t\t" . '<meta name="description" content="Need to contact ' . $n3u_configVars['SiteName'] . '? This page will allow you to do just that!">' . PHP_EOL
  56. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  57. . "\t\t" . '<script type="text/javascript">var RecaptchaOptions = {theme : \'blackglass\'}; </script>' . PHP_EOL
  58. . "\t\t" . '<title>' . $n3u_lang['Contact'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  59. if($n3u_configVars['CleanUrls'] == TRUE){
  60. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  61. }else{
  62. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x='.$n3u_inputVars['x'],FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  63. }
  64. n3u_CacheCSS();
  65. n3u_CacheJS();
  66. echo "\t" . '</head>' . PHP_EOL
  67. . "\t" . '<body>' . PHP_EOL
  68. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  69. . "\t\t\t" . '<div id="header">' . PHP_EOL
  70. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  71. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  72. . "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  73. n3u_Block('header');
  74. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  75. break;
  76. case "error": // If error, do this
  77. echo '<!DOCTYPE html>' . PHP_EOL
  78. . '<html>' . PHP_EOL
  79. . "\t" . '<head>' . PHP_EOL
  80. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  81. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  82. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  83. . "\t\t" . '<meta name="description" content="Sorry, An error has occurred.">' . PHP_EOL
  84. . "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL;
  85. if($n3u_inputVars['q']){
  86. echo "\t\t" . '<title>' . $n3u_inputVars['q'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  87. }else{
  88. echo "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  89. }
  90. n3u_CacheCSS();
  91. n3u_CacheJS();
  92. echo "\t" . '</head>' . PHP_EOL
  93. . "\t" . '<body>' . PHP_EOL
  94. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  95. . "\t\t\t" . '<div id="header">' . PHP_EOL
  96. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  97. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  98. . "\t\t\t\t" . '</div>' . PHP_EOL // div Top
  99. . "\t\t\t" . '</div>' . PHP_EOL; //div header
  100. break;
  101. case "index": // If index, do this
  102. n3u_FetchSearch($n3u_configVars['Prosperent_Endpoint']);
  103. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  104. header("HTTP/1.1 404 Not Found");
  105. }
  106. n3u_CacheBegin(); // Start Caching
  107. echo '<!DOCTYPE html>' . PHP_EOL
  108. . '<html>' . PHP_EOL
  109. . "\t" . '<head>' . PHP_EOL
  110. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  111. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  112. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  113. . "\t\t" . '<meta name="description" content="Thanks for visiting ' . $n3u_configVars['SiteName'] . '! Here you may find much relating to ' . $n3u_configVars['defaultKeyword'] . '. Please enjoy the website!">' . PHP_EOL;
  114. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  115. echo "\t\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
  116. }else{
  117. echo "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL;
  118. }
  119. if($n3u_inputVars['q']){
  120. echo "\t\t" . '<title>' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  121. }else{
  122. echo "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  123. }
  124. n3u_CacheCSS();
  125. echo "\t\t" . '<script type="text/javascript">' . PHP_EOL
  126. . "\t\t\t" . '<!--' . PHP_EOL
  127. . "\t\t\t\t" . 'prosperent_pa_uid = '.$n3u_configVars['Prosperent_UserID'].';' . PHP_EOL
  128. . "\t\t\t\t" . 'prosperent_pa_fallback_query = \''.$n3u_configVars['defaultKeyword'].'\';' . PHP_EOL
  129. // . "\t\t\t\t" . 'prosperent_pa_fallback_query_is_default = 1;' . PHP_EOL
  130. . "\t\t\t" . '//-->' . PHP_EOL
  131. . "\t\t" . '</script>' . PHP_EOL;
  132. n3u_CacheJS();
  133. echo "\t" . '</head>' . PHP_EOL
  134. . "\t" . '<body>' . PHP_EOL
  135. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  136. . "\t\t\t" . '<div id="header">' . PHP_EOL
  137. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  138. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  139. . "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  140. n3u_Block('header');
  141. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  142. break;
  143. case "item": // If item, do this
  144. n3u_FetchItem($n3u_configVars['Prosperent_Endpoint']);
  145. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  146. header("HTTP/1.1 404 Not Found");
  147. }
  148. foreach($n3u_results as $n3u_result){
  149. // loop through, This is needed
  150. }
  151. echo '<!DOCTYPE html>' . PHP_EOL
  152. . '<html>' . PHP_EOL
  153. . "\t" . '<head>' . PHP_EOL
  154. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  155. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  156. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  157. . "\t\t" . '<meta name="description" content="' . substr(n3u_TitleCleaner(str_replace(array("\t\t\t\t\t\t",PHP_EOL),'',n3u_extract($n3u_result['description'],'2',FALSE))),0,160) . '">' . PHP_EOL;
  158. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  159. echo "\t\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
  160. }else{
  161. echo "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL;
  162. }
  163. if(isset($n3u_result['keyword'])){
  164. echo "\t\t" . '<title>' . substr($n3u_result['keyword'],0,55) . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  165. }else{
  166. echo "\t\t" . '<title>' . substr($n3u_inputVars['q'],0,55) . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  167. }
  168. if($n3u_configVars['CleanUrls'] == TRUE){
  169. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '_'.$n3u_inputVars['item'].'.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  170. }else{
  171. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x=item&amp;item=' . $n3u_inputVars['item'],FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  172. }
  173. n3u_CacheCSS();
  174. echo "\t\t" . '<script type="text/javascript">' . PHP_EOL
  175. . "\t\t\t" . '<!--' . PHP_EOL
  176. . "\t\t\t\t" . 'prosperent_pa_uid = '.$n3u_configVars['Prosperent_UserID'].';' . PHP_EOL
  177. . "\t\t\t\t" . 'prosperent_pa_fallback_query = \''.$n3u_configVars['defaultKeyword'].'\';' . PHP_EOL
  178. // . "\t\t\t\t" . 'prosperent_pa_fallback_query_is_default = 1;' . PHP_EOL
  179. . "\t\t\t" . '//-->' . PHP_EOL
  180. . "\t\t" . '</script>' . PHP_EOL;
  181. n3u_CacheJS();
  182. echo "\t" . '</head>' . PHP_EOL
  183. . "\t" . '<body>' . PHP_EOL
  184. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  185. . "\t\t\t" . '<div id="header">' . PHP_EOL
  186. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  187. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  188. . "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  189. n3u_Block('header');
  190. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  191. break;
  192. case "login": // If login, do this
  193. echo '<!DOCTYPE html>' . PHP_EOL
  194. . '<html>' . PHP_EOL
  195. . "\t" . '<head>' . PHP_EOL
  196. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  197. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  198. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  199. . "\t\t" . '<meta name="description" content="You must first login. You may do so on this page.">' . PHP_EOL
  200. . "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL
  201. . "\t\t" . '<script type="text/javascript">var RecaptchaOptions = {theme : \'blackglass\'}; </script>' . PHP_EOL
  202. . "\t\t" . '<title>' . $n3u_lang['Login'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  203. n3u_CacheCSS();
  204. n3u_CacheJS();
  205. echo "\t" . '</head>' . PHP_EOL
  206. . "\t" . '<body>' . PHP_EOL
  207. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  208. . "\t\t\t" . '<div id="header">' . PHP_EOL
  209. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  210. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  211. . "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  212. n3u_Block('header');
  213. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  214. break;
  215. case "logout": // If logout, do this
  216. echo '<!DOCTYPE html>' . PHP_EOL
  217. . '<html>' . PHP_EOL
  218. . "\t" . '<head>' . PHP_EOL
  219. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  220. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  221. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  222. . "\t\t" . '<meta name="description" content="You have been logged out.">' . PHP_EOL
  223. . "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL
  224. . "\t\t" . '<title>' . $n3u_lang['LogOut'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  225. n3u_CacheCSS();
  226. n3u_CacheJS();
  227. echo "\t" . '</head>' . PHP_EOL
  228. . "\t" . '<body>' . PHP_EOL
  229. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  230. . "\t\t\t" . '<div id="header">' . PHP_EOL
  231. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  232. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  233. . "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  234. n3u_Block('header');
  235. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  236. break;
  237. case "privacy": // If Privacy, do this
  238. n3u_CacheBegin(); // Start Caching
  239. echo '<!DOCTYPE html>' . PHP_EOL
  240. . '<html>' . PHP_EOL
  241. . "\t" . '<head>' . PHP_EOL
  242. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  243. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  244. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  245. . "\t\t" . '<meta name="description" content="This is the Privacy Policy for ' . $n3u_configVars['SiteName'] . '. Please read over it carefully.">' . PHP_EOL
  246. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  247. . "\t\t" . '<title>' . $n3u_lang['PrivacyPolicy'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  248. if($n3u_configVars['CleanUrls'] == TRUE){
  249. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  250. }else{
  251. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x='.$n3u_inputVars['x'],FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  252. }
  253. n3u_CacheCSS();
  254. n3u_CacheJS();
  255. echo "\t" . '</head>' . PHP_EOL
  256. . "\t" . '<body>' . PHP_EOL
  257. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  258. . "\t\t\t" . '<div id="header">' . PHP_EOL
  259. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  260. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  261. . "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  262. n3u_Block('header');
  263. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  264. break;
  265. case "search": // If Search, do this
  266. n3u_FetchSearch($n3u_configVars['Prosperent_Endpoint']);
  267. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  268. header("HTTP/1.1 404 Not Found");
  269. }
  270. n3u_CacheBegin(); // Start Caching
  271. echo '<!DOCTYPE html>' . PHP_EOL
  272. . '<html>' . PHP_EOL
  273. . "\t" . '<head>' . PHP_EOL
  274. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  275. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  276. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  277. . "\t\t" . '<meta name="description" content="Search Results for ' . @$n3u_inputVars['q']. '. Displaying page ' . $n3u_inputVars['p'] . '">' . PHP_EOL;
  278. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  279. echo "\t\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
  280. }elseif($n3u_inputVars['sort'] != 'REL'){
  281. echo "\t\t" . '<meta name="robots" content="noindex,follow">' . PHP_EOL;
  282. }else{
  283. echo "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL;
  284. }
  285. if($n3u_configVars['CleanUrls'] == TRUE){
  286. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '_'.$n3u_inputVars['m'].'_'.$n3u_inputVars['b'].'_'.urlencode($n3u_inputVars['q']).'-REL-'.$n3u_inputVars['p'].'.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  287. }else{
  288. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x=' . $n3u_inputVars['x'] . '&amp;m=' . urlencode($n3u_inputVars['m']) . '&amp;b=' . urlencode($n3u_inputVars['b']) . '&amp;q=' . urlencode($n3u_inputVars['q']) . '&amp;sort=REL' . '&amp;p='.$n3u_inputVars['p'], FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  289. }
  290. echo "\t\t" . '<link rel="dns-prefetch" href="//prosperent.com">' . PHP_EOL;
  291. n3u_CacheCSS();
  292. if($n3u_configVars['CleanUrls'] == TRUE){
  293. if(isset($n3u_inputVars['q']) && $n3u_inputVars['q'] != $n3u_configVars['defaultKeyword']){
  294. echo "\t\t" . '<link href="feed_'.$n3u_inputVars['m'].'_'.$n3u_inputVars['b'].'_'.urlencode($n3u_inputVars['q']).'-REL-'.$n3u_inputVars['p'].'.xml" rel="alternate" title="' . str_replace($n3u_configVars['defaultKeyword'] .' ','',$n3u_inputVars['q']) . ' - ' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  295. }elseif($n3u_inputVars['q'] == $n3u_configVars['defaultKeyword']){
  296. echo "\t\t" . '<link href="feed_'.$n3u_inputVars['m'].'_'.$n3u_inputVars['b'].'_'.urlencode($n3u_inputVars['q']).'-REL-'.$n3u_inputVars['p'].'.xml" rel="alternate" title="' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  297. }else{
  298. echo "\t\t" . '<link href="feed_'.$n3u_inputVars['m'].'_'.$n3u_inputVars['b'].'_'.urlencode($n3u_inputVars['q']).'-REL-'.$n3u_inputVars['p'].'.xml" rel="alternate" title="' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  299. }
  300. }else{
  301. if(isset($n3u_inputVars['q']) && $n3u_inputVars['q'] != $n3u_configVars['defaultKeyword']){
  302. echo "\t\t" . '<link href="?x=feed' . '&amp;m=' . urlencode($n3u_inputVars['m']) . '&amp;b=' . urlencode($n3u_inputVars['b']) . '&amp;q=' . urlencode($n3u_inputVars['q']) . '&amp;sort=REL' . '&amp;p='.$n3u_inputVars['p'] . '" rel="alternate" title="' . str_replace($n3u_configVars['defaultKeyword'] .' ','',$n3u_inputVars['q']) . ' - ' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  303. }elseif($n3u_inputVars['q'] == $n3u_configVars['defaultKeyword']){
  304. echo "\t\t" . '<link href="?x=feed' . '&amp;m=' . urlencode($n3u_inputVars['m']) . '&amp;b=' . urlencode($n3u_inputVars['b']) . '&amp;q=' . urlencode($n3u_inputVars['q']) . '&amp;sort=REL' . '&amp;p='.$n3u_inputVars['p'] . '" rel="alternate" title="' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  305. }else{
  306. echo "\t\t" . '<link href="?x=feed' . '&amp;m=' . urlencode($n3u_inputVars['m']) . '&amp;b=' . urlencode($n3u_inputVars['b']) . '&amp;q=' . urlencode($n3u_inputVars['q']) . '&amp;sort=REL' . '&amp;p='.$n3u_inputVars['p'] . '" rel="alternate" title="' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  307. }
  308. }
  309. if(isset($n3u_inputVars['q']) && $n3u_inputVars['q'] != $n3u_configVars['defaultKeyword']){
  310. echo "\t\t" . '<title>' . str_replace($n3u_configVars['defaultKeyword'] .' ','',substr($n3u_inputVars['q'],0,55)) . ' - ' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  311. }elseif($n3u_inputVars['q'] == $n3u_configVars['defaultKeyword']){
  312. echo "\t\t" . '<title>' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  313. }else{
  314. echo "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  315. }
  316. n3u_CacheJS();
  317. echo "\t" . '</head>' . PHP_EOL
  318. . "\t" . '<body>' . PHP_EOL
  319. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  320. . "\t\t\t" . '<div id="header">' . PHP_EOL
  321. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  322. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  323. . "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  324. n3u_Block('header');
  325. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  326. break;
  327. case "terms": // If Terms, do this
  328. n3u_CacheBegin(); // Start Caching
  329. echo '<!DOCTYPE html>' . PHP_EOL
  330. . '<html>' . PHP_EOL
  331. . "\t" . '<head>' . PHP_EOL
  332. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  333. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  334. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  335. . "\t\t" . '<meta name="description" content="This is the Terms &amp; Conditions for ' . $n3u_configVars['SiteName'] . '. Please read over them carefully.">' . PHP_EOL
  336. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  337. . "\t\t" . '<title>' . $n3u_lang['TermsConditions'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  338. if($n3u_configVars['CleanUrls'] == TRUE){
  339. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  340. }else{
  341. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x='.$n3u_inputVars['x'],FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  342. }
  343. n3u_CacheCSS();
  344. n3u_CacheJS();
  345. echo "\t" . '</head>' . PHP_EOL
  346. . "\t" . '<body>' . PHP_EOL
  347. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  348. . "\t\t\t" . '<div id="header">' . PHP_EOL
  349. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  350. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  351. . "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  352. n3u_Block('header');
  353. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  354. break;
  355. case "page":
  356. default:
  357. echo '<!DOCTYPE html>' . PHP_EOL
  358. . '<html>' . PHP_EOL
  359. . "\t" . '<head>' . PHP_EOL
  360. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  361. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  362. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  363. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  364. . "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  365. n3u_CacheCSS();
  366. n3u_CacheJS();
  367. echo "\t" . '</head>' . PHP_EOL
  368. . "\t" . '<body>' . PHP_EOL
  369. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  370. . "\t\t\t" . '<div id="header">' . PHP_EOL
  371. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL
  372. . "\t\t\t\t\t" . '<a class="link" href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  373. . "\t\t\t\t" . '</div>' . PHP_EOL // div Top
  374. . "\t\t\t" . '</div>' . PHP_EOL; //div header
  375. break;
  376. }
  377. ?>