PageRenderTime 52ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/BlueJay/header.php

https://github.com/n3u/n3u-Niche-Store
PHP | 464 lines | 439 code | 2 blank | 23 comment | 59 complexity | 003c456d6ad223f2c6a8d827416306c9 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. function n3u_Menu(){
  18. global $n3u_configVars;
  19. global $n3u_lang;
  20. $n3u_customPages = n3u_CustomPages(); // Get array of custom pages
  21. echo "\t\t\t\t\t" . '<div class="TopBar">' . PHP_EOL
  22. . "\t\t\t\t\t\t" . '<nav>' . PHP_EOL
  23. . "\t\t\t\t\t\t\t" . '<ul>' . PHP_EOL
  24. // . "\t\t\t\t\t\t\t\t" . '<li><a href="./" id="MenuHome" target="_self" title="' . $n3u_lang['Home'] . '" type="text/html">' . $n3u_lang['Home'] . '</a></li>' . PHP_EOL
  25. . "\t\t\t\t\t\t\t\t" . '<li>' . PHP_EOL
  26. . "\t\t\t\t\t\t\t\t\t" . '<a href="./" target="_self" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  27. . "\t\t\t\t\t\t\t\t\t" . '<ul>' . PHP_EOL;
  28. foreach($n3u_customPages as $n3u_customPage){
  29. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="'.$n3u_customPage['url'].'" target="_self" title="' . n3u_TitleCleaner($n3u_customPage['name']) . '" type="text/html">' . $n3u_customPage['name'] . '</a></li>' . PHP_EOL;
  30. }
  31. if($n3u_configVars['CleanUrls'] == TRUE){
  32. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="privacy.htm" target="_self" title="' . n3u_TitleCleaner($n3u_lang['PrivacyPolicy']) . '" type="text/html">' . $n3u_lang['PrivacyPolicy'] . '</a></li>' . PHP_EOL
  33. . "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="terms.htm" target="_self" title="' . n3u_TitleCleaner($n3u_lang['TermsConditions']) . '" type="text/html">' . $n3u_lang['TermsConditions'] . '</a></li>' . PHP_EOL
  34. . "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="contact.htm" target="_self" title="' . n3u_TitleCleaner($n3u_lang['Contact']) . '" type="text/html">' . $n3u_lang['Contact'] . '</a></li>' . PHP_EOL;
  35. }else{
  36. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . filter_var($n3u_configVars['self'] . '?x=privacy', FILTER_SANITIZE_URL) . '" target="_self" title="' . n3u_TitleCleaner($n3u_lang['PrivacyPolicy']) . '" type="text/html">' . $n3u_lang['PrivacyPolicy'] . '</a></li>' . PHP_EOL
  37. . "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . filter_var($n3u_configVars['self'] . '?x=terms', FILTER_SANITIZE_URL) . '" target="_self" title="' . n3u_TitleCleaner($n3u_lang['TermsConditions']) . '" type="text/html">' . $n3u_lang['TermsConditions'] . '</a></li>' . PHP_EOL
  38. . "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . filter_var($n3u_configVars['self'] . '?x=contact', FILTER_SANITIZE_URL) . '" target="_self" title="' . n3u_TitleCleaner($n3u_lang['Contact']) . '" type="text/html">' . $n3u_lang['Contact'] . '</a></li>' . PHP_EOL;
  39. }
  40. echo "\t\t\t\t\t\t\t\t\t" . '</ul>' . PHP_EOL
  41. . "\t\t\t\t\t\t\t\t" . '</li>' . PHP_EOL
  42. . "\t\t\t\t\t\t\t\t" . '<li>' . PHP_EOL
  43. . "\t\t\t\t\t\t\t\t\t" . '<a title="Categories">' . $n3u_lang['Categories'] . '</a>' . PHP_EOL
  44. . "\t\t\t\t\t\t\t\t\t" . '<ul>' . PHP_EOL;
  45. $n3u_configVars['CategoriesList'] = explode(',', str_replace(', ',',',$n3u_configVars['Categories']));
  46. if($n3u_configVars['CleanUrls'] == TRUE){
  47. foreach($n3u_configVars['CategoriesList'] as $n3u_Category){
  48. $n3u_category_url = filter_var('search___'. urlencode($n3u_configVars['defaultKeyword'] . ' ' . $n3u_Category) . '-REL-1.htm', FILTER_SANITIZE_URL); // &b=&m=&q=&price_min=&price_max=&sort=&p=
  49. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . $n3u_category_url . '" title="' . n3u_TitleCleaner($n3u_Category). '">' . $n3u_Category . '</a></li>' . PHP_EOL;
  50. }
  51. }else{
  52. foreach($n3u_configVars['CategoriesList'] as $n3u_Category){
  53. $n3u_category_url = filter_var($n3u_configVars['self'] . '?x=search&amp;m=&amp;b=&amp;q='. urlencode($n3u_configVars['defaultKeyword'] . ' ' . $n3u_Category), FILTER_SANITIZE_URL) .'&amp;sort=&amp;p=1';
  54. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . $n3u_category_url . '" title="' . n3u_TitleCleaner($n3u_Category). '">' . $n3u_Category . '</a></li>' . PHP_EOL;
  55. }
  56. }
  57. echo "\t\t\t\t\t\t\t\t\t" . '</ul>' . PHP_EOL
  58. . "\t\t\t\t\t\t\t\t" . '</li>' . PHP_EOL; // Categories
  59. // . "\t\t\t\t\t\t\t\t" . '<li><a title="Browse by...">Browse by...</a></li>' . PHP_EOL // Categories
  60. if(defined('admin')){
  61. echo "\t\t\t\t\t\t\t\t" . '<li>' . PHP_EOL;
  62. if($n3u_configVars['CleanUrls'] == TRUE){
  63. echo "\t\t\t\t\t\t\t\t\t" . '<a href="admin.htm" title="' . n3u_TitleCleaner($n3u_lang['Administration']) . '">' . $n3u_lang['Administration'] . '</a>' . PHP_EOL;
  64. }else{
  65. echo "\t\t\t\t\t\t\t\t\t" . '<a href="index.php?x=admin" title="' . n3u_TitleCleaner($n3u_lang['Administration']) . '">' . $n3u_lang['Administration'] . '</a>' . PHP_EOL;
  66. }
  67. echo "\t\t\t\t\t\t\t\t\t" . '<ul>' . PHP_EOL;
  68. $n3u_configVars['AdminCatList'] = array('blocks','cache','main','messages','pages','stats','templates');
  69. if($n3u_configVars['CleanUrls'] == TRUE){
  70. foreach($n3u_configVars['AdminCatList'] as $n3u_Category){
  71. $n3u_category_url = filter_var('admin_'. urlencode($n3u_Category) . '.htm', FILTER_SANITIZE_URL); // admin_main.htm
  72. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a class="link" href="' . $n3u_category_url . '" title="' . n3u_TitleCleaner($n3u_Category). '">' . ucfirst($n3u_Category) . '</a></li>' . PHP_EOL;
  73. }
  74. }else{
  75. foreach($n3u_configVars['AdminCatList'] as $n3u_Category){
  76. $n3u_category_url = filter_var($n3u_configVars['self'] . '?x=admin&amp;page='. urlencode($n3u_Category), FILTER_SANITIZE_URL); // ?x=admin&page=main
  77. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a class="link" href="' . $n3u_category_url . '" title="' . n3u_TitleCleaner($n3u_Category). '">' . ucfirst($n3u_Category) . '</a></li>' . PHP_EOL;
  78. }
  79. }
  80. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a class="logout" href="'. $n3u_configVars['self'] .'?x=logout">' . $n3u_lang['LogOut'] . '</a></li>' . PHP_EOL
  81. . "\t\t\t\t\t\t\t\t\t\t" . '<li>' . PHP_EOL
  82. . "\t\t\t\t\t\t\t\t\t\t\t" . '<form id="menu_form" method="post" action="' . $n3u_configVars['self'] . '">' . PHP_EOL
  83. . "\t\t\t\t\t\t\t\t\t\t\t\t" . '<select name="ClearCache" onchange="this.form.submit()">' . PHP_EOL
  84. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option disabled selected>' . $n3u_lang['ClearCache_Options'] . '</option>' . PHP_EOL
  85. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option value="ClearCacheFiles">' . $n3u_lang['ClearCache_Files'] . '</option>' . PHP_EOL
  86. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option value="ClearAllImages">' . $n3u_lang['ClearCache_Imgs_All'] . '</option>' . PHP_EOL
  87. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option value="ClearLastAccessedImages">' . $n3u_lang['ClearCache_Imgs_Acc'] . '</option>' . PHP_EOL
  88. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option value="ClearLastModifiedImages">' . $n3u_lang['ClearCache_Imgs_Mod'] . '</option>' . PHP_EOL
  89. . "\t\t\t\t\t\t\t\t\t\t\t\t" . '</select>' . PHP_EOL
  90. . "\t\t\t\t\t\t\t\t\t\t\t" . '</form>' . PHP_EOL
  91. . "\t\t\t\t\t\t\t\t\t\t" . '</li>' . PHP_EOL
  92. . "\t\t\t\t\t\t\t\t\t" . '</ul>' . PHP_EOL
  93. . "\t\t\t\t\t\t\t\t" . '</li>' . PHP_EOL;
  94. }
  95. echo "\t\t\t\t\t\t\t" . '</ul>' . PHP_EOL
  96. . "\t\t\t\t\t\t" . '</nav>' . PHP_EOL
  97. . "\t\t\t\t\t" . '</div>' . PHP_EOL;// div TopBar
  98. }
  99. switch($n3u_inputVars['x']){
  100. case "download":
  101. case "feed":
  102. case "go":
  103. // do nothing
  104. break;
  105. case "admin": // If Admin, do this
  106. echo '<!DOCTYPE html>' . PHP_EOL
  107. . '<html>' . PHP_EOL
  108. . "\t" . '<head>' . PHP_EOL
  109. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  110. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  111. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  112. . "\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;
  113. if(isset($n3u_PostVars) && $n3u_PostVars != NULL){
  114. echo "\t\t" . '<meta http-equiv="refresh" content="0">' . PHP_EOL;
  115. }
  116. echo "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL
  117. . "\t\t" . '<title>' . $n3u_lang['Admin_Panel'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  118. n3u_CacheCSS();
  119. n3u_CacheJS();
  120. echo "\t" . '</head>' . PHP_EOL
  121. . "\t" . '<body>' . PHP_EOL
  122. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  123. . "\t\t\t" . '<div id="header">' . PHP_EOL
  124. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  125. n3u_Menu();
  126. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  127. n3u_Block('header');
  128. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  129. break;
  130. case "contact": // If contact, do this
  131. echo '<!DOCTYPE html>' . PHP_EOL
  132. . '<html>' . PHP_EOL
  133. . "\t" . '<head>' . PHP_EOL
  134. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  135. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  136. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  137. . "\t\t" . '<meta name="description" content="Need to contact ' . $n3u_configVars['SiteName'] . '? This page will allow you to do just that!">' . PHP_EOL
  138. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  139. . "\t\t" . '<script type="text/javascript">var RecaptchaOptions = {theme : \'blackglass\'}; </script>' . PHP_EOL
  140. . "\t\t" . '<title>' . $n3u_lang['Contact'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  141. if($n3u_configVars['CleanUrls'] == TRUE){
  142. 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;
  143. }else{
  144. 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;
  145. }
  146. n3u_CacheCSS();
  147. n3u_CacheJS();
  148. echo "\t" . '</head>' . PHP_EOL
  149. . "\t" . '<body>' . PHP_EOL
  150. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  151. . "\t\t\t" . '<div id="header">' . PHP_EOL
  152. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  153. n3u_Menu();
  154. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  155. n3u_Block('header');
  156. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  157. break;
  158. case "error": // If error, do this
  159. echo '<!DOCTYPE html>' . PHP_EOL
  160. . '<html>' . PHP_EOL
  161. . "\t" . '<head>' . PHP_EOL
  162. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  163. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  164. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  165. . "\t\t" . '<meta name="description" content="Sorry, An error has occurred.">' . PHP_EOL
  166. . "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL;
  167. if($n3u_inputVars['q']){
  168. echo "\t\t" . '<title>' . $n3u_inputVars['q'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  169. }else{
  170. echo "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  171. }
  172. n3u_CacheCSS();
  173. n3u_CacheJS();
  174. echo "\t" . '</head>' . PHP_EOL
  175. . "\t" . '<body>' . PHP_EOL
  176. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  177. . "\t\t\t" . '<div id="header">' . PHP_EOL
  178. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  179. n3u_Menu();
  180. echo "\t\t\t\t" . '</div>' . PHP_EOL // div Top
  181. . "\t\t\t" . '</div>' . PHP_EOL; //div header
  182. break;
  183. case "index": // If index, do this
  184. n3u_FetchSearch($n3u_configVars['Prosperent_Endpoint']);
  185. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  186. header("HTTP/1.1 404 Not Found");
  187. }
  188. n3u_CacheBegin(); // Start Caching
  189. echo '<!DOCTYPE html>' . PHP_EOL
  190. . '<html>' . PHP_EOL
  191. . "\t" . '<head>' . PHP_EOL
  192. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  193. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  194. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  195. . "\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;
  196. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  197. echo "\t\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
  198. }else{
  199. echo "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL;
  200. }
  201. if($n3u_inputVars['q']){
  202. echo "\t\t" . '<title>' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  203. }else{
  204. echo "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  205. }
  206. n3u_CacheCSS();
  207. echo "\t\t" . '<script type="text/javascript">' . PHP_EOL
  208. . "\t\t\t" . '<!--' . PHP_EOL
  209. . "\t\t\t\t" . 'prosperent_pa_uid = '.$n3u_configVars['Prosperent_UserID'].';' . PHP_EOL
  210. . "\t\t\t\t" . 'prosperent_pa_fallback_query = \''.$n3u_configVars['defaultKeyword'].'\';' . PHP_EOL
  211. // . "\t\t\t\t" . 'prosperent_pa_fallback_query_is_default = 1;' . PHP_EOL
  212. . "\t\t\t" . '//-->' . PHP_EOL
  213. . "\t\t" . '</script>' . PHP_EOL;
  214. n3u_CacheJS();
  215. echo "\t" . '</head>' . PHP_EOL
  216. . "\t" . '<body>' . PHP_EOL
  217. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  218. . "\t\t\t" . '<div id="header">' . PHP_EOL
  219. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  220. n3u_Menu();
  221. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  222. n3u_Block('header');
  223. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  224. break;
  225. case "item": // If item, do this
  226. n3u_FetchItem($n3u_configVars['Prosperent_Endpoint']);
  227. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  228. header("HTTP/1.1 404 Not Found");
  229. }
  230. foreach($n3u_results as $n3u_result){
  231. // loop through, This is needed
  232. }
  233. echo '<!DOCTYPE html>' . PHP_EOL
  234. . '<html>' . PHP_EOL
  235. . "\t" . '<head>' . PHP_EOL
  236. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  237. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  238. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  239. . "\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;
  240. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  241. echo "\t\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
  242. }else{
  243. echo "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL;
  244. }
  245. if(isset($n3u_result['keyword'])){
  246. echo "\t\t" . '<title>' . substr($n3u_result['keyword'],0,55) . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  247. }else{
  248. echo "\t\t" . '<title>' . substr($n3u_inputVars['q'],0,55) . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  249. }
  250. if($n3u_configVars['CleanUrls'] == TRUE){
  251. 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;
  252. }else{
  253. 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;
  254. }
  255. n3u_CacheCSS();
  256. echo "\t\t" . '<script type="text/javascript">' . PHP_EOL
  257. . "\t\t\t" . '<!--' . PHP_EOL
  258. . "\t\t\t\t" . 'prosperent_pa_uid = '.$n3u_configVars['Prosperent_UserID'].';' . PHP_EOL
  259. . "\t\t\t\t" . 'prosperent_pa_fallback_query = \''.$n3u_configVars['defaultKeyword'].'\';' . PHP_EOL
  260. // . "\t\t\t\t" . 'prosperent_pa_fallback_query_is_default = 1;' . PHP_EOL
  261. . "\t\t\t" . '//-->' . PHP_EOL
  262. . "\t\t" . '</script>' . PHP_EOL;
  263. n3u_CacheJS();
  264. echo "\t" . '</head>' . PHP_EOL
  265. . "\t" . '<body>' . PHP_EOL
  266. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  267. . "\t\t\t" . '<div id="header">' . PHP_EOL
  268. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  269. n3u_Menu();
  270. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  271. n3u_Block('header');
  272. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  273. break;
  274. case "login": // If login, do this
  275. echo '<!DOCTYPE html>' . PHP_EOL
  276. . '<html>' . PHP_EOL
  277. . "\t" . '<head>' . PHP_EOL
  278. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  279. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  280. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  281. . "\t\t" . '<meta name="description" content="You must first login. You may do so on this page.">' . PHP_EOL
  282. . "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL
  283. . "\t\t" . '<script type="text/javascript">var RecaptchaOptions = {theme : \'white\'}; </script>' . PHP_EOL
  284. . "\t\t" . '<title>' . $n3u_lang['Login'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  285. n3u_CacheCSS();
  286. n3u_CacheJS();
  287. echo "\t" . '</head>' . PHP_EOL
  288. . "\t" . '<body>' . PHP_EOL
  289. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  290. . "\t\t\t" . '<div id="header">' . PHP_EOL
  291. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  292. n3u_Menu();
  293. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  294. n3u_Block('header');
  295. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  296. break;
  297. case "logout": // If logout, do this
  298. echo '<!DOCTYPE html>' . PHP_EOL
  299. . '<html>' . PHP_EOL
  300. . "\t" . '<head>' . PHP_EOL
  301. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  302. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  303. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  304. . "\t\t" . '<meta name="description" content="You have been logged out.">' . PHP_EOL
  305. . "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL
  306. . "\t\t" . '<title>' . $n3u_lang['LogOut'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  307. n3u_CacheCSS();
  308. n3u_CacheJS();
  309. echo "\t" . '</head>' . PHP_EOL
  310. . "\t" . '<body>' . PHP_EOL
  311. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  312. . "\t\t\t" . '<div id="header">' . PHP_EOL
  313. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  314. n3u_Menu();
  315. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  316. n3u_Block('header');
  317. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  318. break;
  319. case "privacy": // If Privacy, do this
  320. n3u_CacheBegin(); // Start Caching
  321. echo '<!DOCTYPE html>' . PHP_EOL
  322. . '<html>' . PHP_EOL
  323. . "\t" . '<head>' . PHP_EOL
  324. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  325. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  326. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  327. . "\t\t" . '<meta name="description" content="This is the Privacy Policy for ' . $n3u_configVars['SiteName'] . '. Please read over it carefully.">' . PHP_EOL
  328. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  329. . "\t\t" . '<title>' . $n3u_lang['PrivacyPolicy'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  330. if($n3u_configVars['CleanUrls'] == TRUE){
  331. 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;
  332. }else{
  333. 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;
  334. }
  335. n3u_CacheCSS();
  336. n3u_CacheJS();
  337. echo "\t" . '</head>' . PHP_EOL
  338. . "\t" . '<body>' . PHP_EOL
  339. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  340. . "\t\t\t" . '<div id="header">' . PHP_EOL
  341. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  342. n3u_Menu();
  343. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  344. n3u_Block('header');
  345. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  346. break;
  347. case "search": // If Search, do this
  348. n3u_FetchSearch($n3u_configVars['Prosperent_Endpoint']);
  349. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  350. header("HTTP/1.1 404 Not Found");
  351. }
  352. n3u_CacheBegin(); // Start Caching
  353. echo '<!DOCTYPE html>' . PHP_EOL
  354. . '<html>' . PHP_EOL
  355. . "\t" . '<head>' . PHP_EOL
  356. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  357. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  358. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  359. . "\t\t" . '<meta name="description" content="Search Results for ' . @$n3u_inputVars['q']. '. Displaying page ' . $n3u_inputVars['p'] . '">' . PHP_EOL;
  360. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  361. echo "\t\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
  362. }elseif($n3u_inputVars['sort'] != 'REL'){
  363. echo "\t\t" . '<meta name="robots" content="noindex,follow">' . PHP_EOL;
  364. }else{
  365. echo "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL;
  366. }
  367. if($n3u_configVars['CleanUrls'] == TRUE){
  368. 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;
  369. }else{
  370. 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;
  371. }
  372. echo "\t\t" . '<link rel="dns-prefetch" href="//prosperent.com">' . PHP_EOL;
  373. n3u_CacheCSS();
  374. if($n3u_configVars['CleanUrls'] == TRUE){
  375. if(isset($n3u_inputVars['q']) && $n3u_inputVars['q'] != $n3u_configVars['defaultKeyword']){
  376. 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;
  377. }elseif($n3u_inputVars['q'] == $n3u_configVars['defaultKeyword']){
  378. 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;
  379. }else{
  380. 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;
  381. }
  382. }else{
  383. if(isset($n3u_inputVars['q']) && $n3u_inputVars['q'] != $n3u_configVars['defaultKeyword']){
  384. 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;
  385. }elseif($n3u_inputVars['q'] == $n3u_configVars['defaultKeyword']){
  386. 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;
  387. }else{
  388. 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;
  389. }
  390. }
  391. if(isset($n3u_inputVars['q']) && $n3u_inputVars['q'] != $n3u_configVars['defaultKeyword']){
  392. echo "\t\t" . '<title>' . str_replace($n3u_configVars['defaultKeyword'] .' ','',substr($n3u_inputVars['q'],0,55)) . ' - ' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  393. }elseif($n3u_inputVars['q'] == $n3u_configVars['defaultKeyword']){
  394. echo "\t\t" . '<title>' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  395. }else{
  396. echo "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  397. }
  398. n3u_CacheJS();
  399. echo "\t" . '</head>' . PHP_EOL
  400. . "\t" . '<body>' . PHP_EOL
  401. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  402. . "\t\t\t" . '<div id="header">' . PHP_EOL
  403. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  404. n3u_Menu();
  405. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  406. n3u_Block('header');
  407. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  408. break;
  409. case "terms": // If Terms, do this
  410. n3u_CacheBegin(); // Start Caching
  411. echo '<!DOCTYPE html>' . PHP_EOL
  412. . '<html>' . PHP_EOL
  413. . "\t" . '<head>' . PHP_EOL
  414. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  415. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  416. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  417. . "\t\t" . '<meta name="description" content="This is the Terms &amp; Conditions for ' . $n3u_configVars['SiteName'] . '. Please read over them carefully.">' . PHP_EOL
  418. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  419. . "\t\t" . '<title>' . $n3u_lang['TermsConditions'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  420. if($n3u_configVars['CleanUrls'] == TRUE){
  421. 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;
  422. }else{
  423. 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;
  424. }
  425. n3u_CacheCSS();
  426. n3u_CacheJS();
  427. echo "\t" . '</head>' . PHP_EOL
  428. . "\t" . '<body>' . PHP_EOL
  429. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  430. . "\t\t\t" . '<div id="header">' . PHP_EOL
  431. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  432. n3u_Menu();
  433. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  434. n3u_Block('header');
  435. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  436. break;
  437. case "page":
  438. default:
  439. echo '<!DOCTYPE html>' . PHP_EOL
  440. . '<html>' . PHP_EOL
  441. . "\t" . '<head>' . PHP_EOL
  442. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  443. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  444. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  445. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  446. . "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  447. n3u_CacheCSS();
  448. n3u_CacheJS();
  449. echo "\t" . '</head>' . PHP_EOL
  450. . "\t" . '<body>' . PHP_EOL
  451. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  452. . "\t\t\t" . '<div id="header">' . PHP_EOL
  453. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  454. n3u_Menu();
  455. echo "\t\t\t\t" . '</div>' . PHP_EOL // div Top
  456. . "\t\t\t" . '</div>' . PHP_EOL; //div header
  457. break;
  458. }
  459. ?>